~ All about Salesforce

Update lookup field using Process Flow

It has been a long time:), let me share few posts on Process Builder and Flows which I have been using them recently.

Requirement:

Need to update a lookup field in an object. We have a Location field as a lookup in a custom object(say Rate Card). This should get populated from Account’s location when a new rate card is created. Account is a lookup field in the Rate Card and it is a required field.

Analysis:

Earlier, the requirement could only be achieved through APEX code as we cannot use Workflow Field update for lookup fields, but with the introduction of Process Builder, it is possible to update lookup field through Process flow. Wow, it’s a boon for developers:)

Solution:

Create a process as per the screenshot below:

The process will be executed upon Rate Card record creation.

Check if Location field is empty and if so, update it:

Create an Immediate action to update the Location field:

Note the value, we have taken Rate Card’s account’s location and updated in Location field of Rate Card.

P.S: It is possible to update lookup field using Visual flow. Please find the screenshot below which shows account id update(account is a lookup field in Opportunity object) in Record update step in Visual flow.

I need to update a lookup field on an account. I have a NAICS Code field from data.com on the account page that gives us a company’s NAICS Code. I need to find this code in my custom object NAICS__c through the lookup field I have on my account to that object.

I have watched a few youtube demos but they were utterly confusing to me.
Can you Help?

sorry for my late response as I was not active in my blog for a couple of months in the past. If the issue is still not resolved, here is my understanding of the requirement:

You have a lookup field on the account which you want to update by querying the custom object NAICS__c.

If you want to achieve it by config, it has to be the combination of process and a visual flow. Call the process which will get triggered when you want to do the update(when the account is created or updated) and within the process, call the flow which will update the lookup field by querying on NAICS__c. Please let me know for any questions.