0

I'm trying to use Process Builder in conjunction with a Flow to update records. My Org uses Person Accounts and I have a custom Junction Ojbect linking Contacts to another Custom Object. When a field on the Contact object is changed I need to get all the Junction Objects for that Contact, then get all the Custom Objects on the other side of the junction and update a field on those objects with the new value from the Contact.

I have the Process Builder setup on Account to run on Create and Edit, when it detects a change in the field value from the Contact (i.e. Contact_Custom_Field__pc) to run a Flow. The Process Builder passes the PersonContact record to the Flow by reference.

Judging by the logs this is working.

12:50:49:717 FLOW_VALUE_ASSIGNMENT 89806e79afd5a9e3936f3390efb1528427405b-3f49|BaseContact|{LastModifiedDate=2016-01-27 17:50:49, AccountId=001f000000o9lJhAAI, DoNotCall=false, Custom_Contact_Field__c=true,  OwnerId=005C0000008cyo4IAA, CreatedById=005C0000008cyo4IAA, IsDeleted=false, IsEmailBounced=false, IsPersonAccount=true, FirstName=Test, HasOptedOutOfEmail=false, SystemModstamp=2016-01-27 17:50:49, RM_Name__c= ,  CreatedDate=2016-01-26 20:39:03, Id=003f000000pfGUCAA2, LastName=Test Record, LastModifiedById=005C0000008cyo4IAA}

Where BaseContact is an SObject Variable set as input only in my Flow.

I use the Id field on BaseContact with a Fast Lookup to get a SObject COllection of my Junction Objects. I then loop through the Junction Objects doing Fast Lookups to get my Custom Object. I loop through my Custom Objects and use an assignment to assign the BaseContact.Custom_Conact_Field__c to the appropriate value on my Custom Object. In the same assignment I'm adding the Custom Object to a SObject Collection.

enter image description here

When all the Lookups and Loops are done I use fast update to update my Custom Objects. As best I can tell from the Logs my Custom Object is getting updated (it's going through Validation and Workflow rules), but the field I'm trying to assign is not updating in any way.

2

One major pitfall I ran into with fast updates is that you can't update a collection of object you retrieved from the DB - you have to add them to a NEW collection then use fast update on that one. I wanted to mention that as I spent a lot of time troubleshooting that issue. It sounds like you are already doing this in your assignment step though so that may be something different. One thing I would try to troubleshoot is replacing the fast update with record updates (in a loop) and see if those make it.

1

There could be two possible answers to this problem.I recently faced this issue and found two problems in flows.

  1. If you are using any kind of decision box in flow do specify the else condition also, if you wont do that it makes your variables/collection blank and updates will not be performed.

  2. If you are using any kind of collection to iterate your logic on it and then updating data in the system, so before making any updates copy your current collection into a second collection.Your update(Fast update/record update) both wont work until you this.

  • Part 2 worked for me. I swear I had flows that updated the collection that was pulled from SF, but it wasn't working here. Just created a new assign in my loop and it worked perfectly. – denvergreene Jun 15 '16 at 22:18

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.