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
mcc22mcc22 

Why is the URL valid when used alone but "in-valid" within a formula?

Greetings all,
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.

When used separately the URLs work without error. However, when I try to use the same URLs in an IF function, it returns "Error: Enter a URL that is valid and well-formed." 
(!IF(Fulfillment__c.Shipping_Carrier__c = "UPS® Ground",
https://www.ups.com/track?loc=en_US&tracknum={!Fulfillment__c.Packaging_Tracking_Number__c}&requester=WT/trackdetails,

(IF(Fulfillment__c.Shipping_Carrier__c = “Standard Freight", https://trackmyparcel.com.au/{Fulfillment__c.Packaging_Tracking_Number__c}
))
There are other posts containing this error but none resolve my issue. I would be most grateful for any direction on this error. Or if there is another approach to meet this requirement. Thank you. 
AnudeepAnudeep (Salesforce Developers) 
Can you please try using the same URL in an apex method and debug the URL output along with the merge fields?

The issue appears to be with any of the following URLs

https://www.ups.com/track?loc=en_US&tracknum={!Fulfillment__c.Packaging_Tracking_Number__c}&requester=WT/trackdetails,
https://trackmyparcel.com.au/{Fulfillment__c.Packaging_Tracking_Number__c}



 
mcc22mcc22
Hi Anudeep, thanks for your reply. I'm not a proficient developer. Would you please provide an example of an apex class, or reference article, I can use to debug the URL output? Many thanks