Trying to create a conditional button.

  • If the Opportunity Record type = 0123t000000J8gLAAS, use this link:

    "https://www.smartbizloans.com/"& Opportunity.Application_Number__c,

  • If the Opportunity Record type = 0123t000000dVwWAAU, use this link: "https://www.smartbizloans.com/"& Opportunity.Originating_Application_Number__c,

This is what I have made but I am getting errors:

IF( Opportunity.RecordType  = 0123t000000J8gLAAS,
    "https://www.smartbizloans.com/admin/loans/"& Opportunity.Application_Number__c, 
    (IF(Opportunity.RecordType = 0123t000000dVwWAAU,
    "https://www.smartbizloans.com/admin/loans/"& Opportunity.Originating_Application_Number__c,

Thank you in advance for the help!! Very much appreciated.

1 Answer 1


Your issue is most likely here:

IF( Opportunity.RecordType  = 0123t000000J8gLAAS

should be (SFDC formula evaluator needs constants to be literal strings):

IF( Opportunity.RecordTypeId  = '0123t000000J8gLAAS'
  • Thank you so much. That solved for the formula! Now I ran into a new issue, when I click the button it opens a new window, but it's a salesforce window still and the error message, "This page isn't available in Salesforce Lightning Experience or mobile app. The display type for the button is Detail Page Button, and the Behavior is Display in new window. Any ideas on how to resolve?
    – Jenna Odom
    Jul 30, 2021 at 15:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .