You need to sign in to do that
Don't have an account?
mcc22
How to use merge fields in formula for detail page button?
Hello,
I am trying to build a detail page button on a custom object (Fulfillment__c) that allows a sales rep to easily track a package. The tracking number and shipping carrier are custom fields. The goal is to leverage the IF function to use the correct URL with (tracking number merge field) based on the shipping carrier. Here's the basic format of my formula.
{!IF(Fulfillment__c.ShippingCarrier = "UPS","https://www.ups.com/{!Fulfillment__c.Tracking_Number__c}", (IF(Fulfillment__c.ShippingCarrier = “FedEx", ”https://fedex.com/{!Fulfillment__c.Tracking_Number__c}”, (IF(Fulfillment__c.ShippingCarrier = “DHL, ”https://dhl.com/{!Fulfillment__c.Tracking_Number__c}” ))))) }I receive a syntax error on the second IF but I'm not exactly sure the cause. Is it possible to use merge fields in the formula? TIA
Greetings!
The way of using the merge fields seems good for me as suggested here (https://help.salesforce.com/articleView?id=sf.links_merge_fields.htm&type=5).
I would suggest you to double check,if the field ShippingCarrier data type.If it text then the above formula should be valid.If it is picklist then you would need to use ISPICKVAL function as suggested here.
Please mark it as best answer if it helps you to fix the issue.
Thank you!
Regards,
Shirisha Pathuri
Thank you for the reply. Yes, the data type is text.
I noticed there's a missing " in the example formula I included above- it should be "DHL". Either way, I still receive the syntax error.
The URLs work as expected separately, my trouble is getting them to play nice together. Any additional support is greatly appreciated.