{!nextStatus} is empty when doing a Mass Update on records.

Posted by alank@daitangroup.com on 09-Aug-2017 08:05

I have triggers set up for Workflow Status changes.

Since some of my Workflow Actions do not change the Status, I needed to set up a "Before Update" Trigger that listens to the Workflow Status field. If {!nextStatus} is blank (meaning that the status won't change, and the Updated Status trigger won't fire), it calls the "Updated Status" trigger by hand.

This was working fine, until I made a mass update to change multiple records' Status.

In the Mass Update case, {!nextStatus} shows as blank, so the Before Update trigger manually calls the Status Changed trigger. Then, the Status are all changed to a new value, and the Status Changed trigger is invoked once again - causing duplicate action, which is undesirable to me.

How do I solve this? {!nextStatus} shouldn't be blank, in my opinion.

Thanks

All Replies

Posted by Shiva Duriseati on 10-Aug-2017 00:55

Hi Alank,

Is your requirement is to change workflow status for workflow actions which do not change the status(Ex: WorkflowAction of type "Send Email")?If yes then create a new trigger of type "Workflow status change" and assign it to the above wf action. It should work fine even with mass update.

If possible can you please share your app.xml so that we will go through and get back?

Regards,

Shiva

This thread is closed