+ Start a Discussion
David Glover 14David Glover 14 

URL button conditional logic not working

I have an account-level opportunity URL button using conditional logic to pre-populate fields that is not working. Below is the syntax. I want to pre-populate the Stage field based on the opportunity record type (i.e. Donation or Grant). In the syntax below, the IF statement always tests negative no matter which record type is used for the opportunity. I've tried both the 15 and 18 character record type id values with no success. I'm getting the record type id value from the URL when I select the Grant record type.
URL button syntax:
/lightning/o/Opportunity/new?count=1&nooverride=1&useRecordTypeCheck=1&defaultFieldValues=AccountId={!Account.Id},Name=Will Auto-Populate,StageName={!IF(Opportunity.RecordTypeId='01241000000PxiNAAS','Awarded','Posted')},Probability=100,npsp__Acknowledgment_Date__c={!TEXT(TODAY())}
Tillman JoseTillman Jose
You can try with following code, there is no need to enclose Opportunity.RECAP_ID__c inside {!}
https://{!IF(NOT(ISNULL(Opportunity.RECAP_ID__c)), "recap.retailcapital.com/backend/account_report.php?id="& Opportunity.RECAP_ID__c,"recap.retailcapital.com")}

PrepaidGiftBalance (https://www.prepaidgiftbalance.vip/www-prepaidgiftbalance-com/)
David Glover 14David Glover 14
I appreciate your reply.  However, the test needed on field Opportunity.RecordTypeId is not whether it is NULL or not but whether it matches the internal value associated with a "Grant" type opportunity.