Skip to Content
author's profile photo Former Member
Former Member

How to delete all the entries in BO using action

Hi All,

Is there any way so that i can delete entries from BO using a action.

Regards,

Atul Malhotra

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 26, 2016 at 11:18 AM

    Hi Atul Malhotra,

    Please write this statement in your custom action.

    CustomBOName.QueryByElements.Execute().Delete();

    Using this single statement you can delete all records from your custom BO.

    Regards,

    Mithun

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 26, 2016 at 11:29 AM

    Hi

    This is because when you delete instance it will only delete the instanaces but does not commit the delete.

    if you are calling your custom action in EventHandler under BOAction you will see checkbox ExecuteAfterSave, You should check this checkbox, and after the calling Deleteinstance .Delete() it will commit the delete.

    Regards

    Sunil

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Sunil.

      If the Action is being called from MDR job , what statement to put after : Deleteinstance .Delete()


      In my case i want to delete a subset of data from Custom BO.


      So Deleteinstance in my case has set of records that i need to delete from Superset BO.


      So in below after BO.Delete what will help to commit delete.





      var resultData = query.Execute(selectionParams);/** Deleting the records **/foreach (var BO in resultData){ BO.Delete();}
  • Posted on May 26, 2016 at 10:11 AM

    Hi Atul,

    Create a custom action and write a code to fetch and then delete all the entries from a Custom BO.

    var CustomBO= CustomBO.QueryByElements;

    var CustomBODelete = CustomBO.Execute();

    Foreach(var Deleteinstance in CustomBODelete)

    {

    Deleteinstance .Delete(); }

    Thanks and Regards,

    Ajith J

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.