2

I'm writing my first plugin for use with process builder. I read the docs, I've seen a few code examples and I don't see what I'm doing wrong.

The flow is defined on update of my custom SObject. I need to update some of it's field and as the logic is not trivial and uses custom settings I need to write some code instead of immediate field updates. My problem is that the SObject passed to the invocable method appears to be read only.

Do I need to use triggers instead?
Anyone would like to speculate why was the limitation imposed?

thanks

1

Assume the object was not made Read only and you had the logic written to update the records in context ,this would have triggered your workflow again,which in turn would have triggered update leading to recursion.

You can always collect Ids from the read-only sobject and query the database with Ids and map with values from the custom setting data.Having said that this may also lead to recursion and its better to have recursion handling mechanism in place .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.