cancel
Showing results for 
Search instead for 
Did you mean: 

Call Event-BeforeSave Action from BO Action

Former Member
0 Kudos

Hello Experts!!!

I have a little issue, I need to call the Event-BeforeSave from BO Action in code. I am trying to call Create() method of the instance but it don't call the Before-Save.

Some idea for solve this issue.

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Thanks for the fast answers.

My situation is as follow, I need to Create Journal Entry automatically so I am using MDR (Mass Data Run) but the MDR only can execute BO-Action and the Journal Entry is only created in Before-Save, so how can i do in this situation? I thought with the MDR execute a BO-Action and then call the Before-Save for create the Journal Entry.

Note: My BO don't have screens.

Regards,

Adriano. 

Former Member
0 Kudos

What is this BO Action of yours doing? Is it making any change in any field of your instance?

Former Member
0 Kudos

Hi Andrio,

After the MDR execution, beforeSave event trigger only once.

You can test in debug/trace.

for example if you have 500 instance to update and you are running MDR, then your custom action update 500 instance then after the BO Action execution, BeforeSave event will trigger.

HTH

Thanks

Sunil

Former Member
0 Kudos

Standard Events will be called only if there is a modification detected within an instance.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Andrio

You can call before event after executing or before executing your action, use the below configuration.

If you check Save Before Execution then your beforeSave event call before executing your action, if you check Save After Execution, then BeforeSave will trigger after executing your custom action.

You can also use the way vonod explain but set the sequence of WindowAction and BOAction.

HTH

Regards:

Sunil

vinodkumar_kommineni
Active Contributor
0 Kudos

Hi Adriano,

Create method would not trigger Before Save because Create would not persist the changes. Only when you trigger save it would persist changes.

You can use the below configuration within your event to save which would trigger the BeforeSave

Alternatively you can try keeping your coding in After Modify as it would be called on create.

Regards

Vinod