tl;dr : If an individual record is in a "Paused Flow Interview" state, and you create a new version of the Process Builder, the record will "wake up" at its specified time and complete the actions as specified in the version of the PB that was active when the record entered the paused state. There is some confusion as to what happens to Process Builders that have "inflight" time-based actions when you create a new version of the PB. The information from Salesforce is incomplete and there are contradictory StackExchange answers, including here. At the time of writing, the first answer answers the wrong question, and the 2nd and 3rd answers fully contradict each other. Clearly this is due for someone to just test it. My Test I conducted the following test - I'm going to create a PB, create a test record, and see what happens if I update the PB while the record is pending. One of three things is going to happen: Nothing will happen to the record The re
Because custom metadata and Flow don't mix , I had to create a service that would run the custom metadata lookup in Apex, where I can control the bulkification. Code Here is some code that will achieve this. It takes a list of field names and a list of values, and a table name, and returns the value from the lookup. To install the code, open Developer Console, and create four files: FlowLookup FlowLookupRequest FlowLookupResult MyException You can copy/paste the code from Github into those files, then save them. That will make the plugin available to your Flow. Step-By-Step Usage Here's an example that looks up a value called a "fireball" from a custom metadata table and assigns the value to a record called iLead__c. Request and Response Formats The process has a request and a response. The request contains: Query Fields - a list of the fields you want to query Query Values - another list of the values for the above fields Result Field - the field to pull the result
Salesforce has been focusing a lot on Flow recently, as they should. It splits the difference nicely between Process Builder and Apex code. We recently used Flow to implement what I'd expect is a common use case - when a record is created, lookup a value from a table and update the record. In this case, it's a light lead score we call a "fireball" value. This worked great since in most use cases we'd get one record at a time. But we found during Lead conversion, we would get a few records through at a time, which caused the process to break with a really odd error: Error Occurred: This error occurred when the flow tried to look up records: Disjunctions not supported. After some research it became clear that this is the error you get when you try to query a custom metadata table using an "OR" condition. But my Flow didn't use an "OR" condition in the metadata lookup. The answer was lurking in this obscure documentation: When you define mult
Comments
Post a Comment