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
Mitchell McLaughlin 1Mitchell McLaughlin 1 

Functions in URL Hack

Hi,

I'm trying to update a phone field conditionally, depending on what the Division is. This IF and ISPICKVAL doesn't seem to be working. Do you see an issue?
Perhaps I'm not sure when to use brackets vs parenthesis. 

Thanks!

/a3l/e?retURL=%2F{!Account.Id}&
&CF00N1h000000PTrn={!Account.Name}
&00N1h000000PTru={!Account.BillingCity}
&00N1h000000PTrr={!Account.BillingStreet}
&00N1h000000PTrx={!Account.BillingCountry}
&00N1h000000PTsi={!Account.BillingPostalCode}
&00N1h000000PTsZ={!Account.BillingStateCode}
&00N1h000000PTrt={!IF(
{!ISPICKVAL(!Account.Division__c, "Quad/Graphics Logistics"){!Account.Phone},
{!Account.Main_Phone_Text__c},
{!Account.Phone})}
&00N1h000000PTsF={!Account.Fax}
Ryan GreeneRyan Greene
Is this writen in a VF Page? If so, then you have way too many exclamation points!! Starting at your IF, you only need one ! after the first {, then no more ! are needed within the brackets. ie: {!IF(ISPICKVAL(Account.Division__c, "Quad/Graphics Logistics")=Account.Phone,Account.Main_Phone_Text__c,
Account.Phone}
Also, you were missing the "="
Ryan GreeneRyan Greene
If that's a formula field, you will need to put {!  } around each Object+Field