You need to sign in to do that
Don't have an account?
Brandon (Penrod)
DMLException Workaround
Goal: On custom object A insert create a Queue and create a separate custom object B that references the Queue we make.
Issue: To avoid the DML Exception the Queue has to be created using a @future method. This creates another issue where the @future code is being called after any of the source trigger and the following processes/flows that result from custom object A being inserted. The processes and flows need to execute after the Queue is created so we can access the Queue's values.
Has anyone else ran into this issue or possibly point me in the right direction?
Issue: To avoid the DML Exception the Queue has to be created using a @future method. This creates another issue where the @future code is being called after any of the source trigger and the following processes/flows that result from custom object A being inserted. The processes and flows need to execute after the Queue is created so we can access the Queue's values.
Has anyone else ran into this issue or possibly point me in the right direction?
1. create a custom rest api endpoint that generates the queue for you. This will be executed synchronously -- your code will wait for the rest call to return. Then assign object b to it.
2: Insert the queue, and then schedule a batch job to execute in 30 seconds to update the record. <-- not high volume safe!
All Answers
1. create a custom rest api endpoint that generates the queue for you. This will be executed synchronously -- your code will wait for the rest call to return. Then assign object b to it.
2: Insert the queue, and then schedule a batch job to execute in 30 seconds to update the record. <-- not high volume safe!
Thanks for the answer, we ended up implementing the scheduled job before you posted didn't get back to this. Since these queue additions aren't high volume we should be good to go.
Brandon