Skip to main content
I'm attempting to create a URL button that has a IF statement that's supposed to lead to an external website if the IF statement is TRUE, and back to the original SF record if the record doesn't satisfy the condition.  I can't seem to get the syntax correct.  So here's the logic:

IF Account ID is NOT blank, then go to https://www.genericwebsite.com/randomwhatever/userId="&[MERGE FIELD ⌗1]&"/zquoteId="&[MERGE FIELD ⌗2],

IF it is blank, the button should return to the record.

How would I write formula for the URL button?

 
1 answer
  1. Aug 7, 2020, 4:26 PM
    Hi Arie,

    Greetings!

    In order to achieve this you might need either to create the OnClcik javaScript button or VF page.

    We have some limitations on the Javascript button which might not work in Lightning experience.If you would like to proceed with the VF page then you might need an Extension to check for the AccountId and then redirect to the record page.

    Here is the sample code which might help you:

    VF page button code:https://salesforce.stackexchange.com/questions/14774/redirect-visualforce-page-issue

    Javascript button code:https://salesforce.stackexchange.com/questions/110693/custom-javascript-button-url-redirect

    Kindly mark it as best answer if it helps so that it can help others in the future.

    Warm Regards,

    Shirisha Pathuri
0/9000