Auto assign tax code to opportunity using the related accounts zip code
I created a process builder rule to look at zip shipping zip code of the account and if it matches a zip code on a tax code record, it should attach that tax code record to the account through the Tax Code look up field. The rule fails to do this and I get this error.
"The flow failed to access the value for myVariable_current.PBSI__Tax_Code_r.Zip_Code__c because it hasn't been assigned"
Any suggestions on how to get this working?
It sounds like you're trying to match an account to a tax code using the zip code - a field that's common to both objects. You should be able to do this, but you'll need to use a flow to do so.
Your flow should have 2 input variables: AccountId and Zipcode. Both would be text, and both marked available for input. Using a Get Records step, your flow will retrieve any tax code record where the zipcode field matches the zipcode variable, and if one is found, update the account record with the ID of the tax code (using the AccountId variable to update the right account). Lastly, you will want to build a process on the Account object that runs the flow, passing over the account's ID and zipcode to the variables.