cancel
Showing results for 
Search instead for 
Did you mean: 

How to delete all the entries in BO using action

Former Member
0 Kudos

Hi All,

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

Regards,

Atul Malhotra

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (2)

Answers (2)

sunil1101
Employee
Employee
0 Kudos

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

apoorva_singh
Active Participant
0 Kudos

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();}
A-J-S
Active Participant
0 Kudos

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

Former Member
0 Kudos

Hi Ajith,

I have already tried it but the data is still showing in OWL screen.

Regards,

Atul

former_member186648
Active Contributor
0 Kudos

Hi Atul,

Log off and relogin.

Thanks, Pradeep.