function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nihar ANihar A 

Issue with process Builder. Field Update not working as expected.

Hello, I am trying to update a field on case object based on the user's currency who is creating the case. I am not able to find $User.currency fields  to directly access the value in criteria. I am using another field on case object which is set to user's Id when it is being created and I am using this custom field to access user's currency.

So logic looks like :

if (case.customfield.defaultcurrencyIsoCode == 'USD') then set Case.country = 'USA' and so on..

But Process is throwing error saying ..The flow failed to access the value for myVariable_current.customfield.DefaultCurrencyIsoCode because it hasn't been set or assigned.

But I am assigning custom field to user id while creating the case. I am not sure why this is working. Any help is appreciated.
John TowersJohn Towers
What is 'Case.customfield' in your schema? Is it a lookup? 
Nihar ANihar A
@John Yes ..it is a look up on User Object .
John TowersJohn Towers
Can you send a screenshot of the criteria and action parts of your process? I'm not following how you have this set up.
Nihar ANihar A
Hi John,

I am calling process builder process when a new case of certain record type is created.  In the actions I am updating some fields on the case record while invoked the process builder actions.

There is one field on case called Country which is causing the issue. The logic I am using to update the country field is :

IF(ISPICKVAL([Case].Internal_Request_Contact__c.CurrencyIsoCode , 'USD') , 'USA', IF(ISPICKVAL([Case].Internal_Request_Contact__c.CurrencyIsoCode , 'CAD') , 'Canada', '') )

Internal request contact field is a field on case object which is a lookup on User. I am assigning this value while creating the case to the current user who created the case.

Please let me know if this is clear or still confusing.

 
John TowersJohn Towers
Makes sense. That error typically happens when you're trying to access a field on a related object but the related object is null. Are you sure that the value for Internal_Request_Contact__c is being populated? Can you do something like this and see if it fixes the issue:
 
IF(
	!ISBLANK([Case].Internal_Request_Contact__c),
	IF(ISPICKVAL([Case].Internal_Request_Contact__c.CurrencyIsoCode , 'USD') , 'USA', 
	IF(ISPICKVAL([Case].Internal_Request_Contact__c.CurrencyIsoCode , 'CAD') , 'Canada', '') )
	,'')



 
Nihar ANihar A
@John, It still says the same error. The flow failed to access the value for myVariable_current.Internal_Request_Contact__c.CurrencyIsoCode because it hasn't been set or assigned. Not sure why this is happening.