Skip to main content

what is the best way to create a lightning Button that when selected checks field criteria and based on the criteria? Opens a new window with a URL to an Adobe Template link to the Accounts Object. I had this in Classic working in a JavaScript Button.

      • {!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}{!REQUIRESCRIPT("/soap/ajax/20.0/apex.js")}

        if('{!Account.Original_Contract_Start__c}' == '' || '{!Account.Current_Contract_Start__c}' == '' || '{!Account.Contract_End__c}' == '' || '{!Account.Status__c}' != 'Active' || '{!Account.Target_Market_Reference__c}' != 'India' )

        {

        window.alert("Hello {!$User.FirstName} - ERROR IN ONE OR ALL OF THE FOLLOWING FIELDS Contract End, Original Contract Start and Current Contract Start CANNOT BE BLANK AND Account Status MUST BE Active AND Recruiting Market MUST CONTAIN India");

        }

        else if('{!Account.Status__c}' == 'Active' && '{!Account.Approval_Progress__c}' == 'Closed Won')

        {

        window.open("/apex/echosign_dev1__AgreementTemplateProcess?masterid={!Account.Id}&templateId=a08o000000C6jYl ");

        }

        else if('{!Account.Status__c}' == 'Active' && '{!Account.Approval_Progress__c}' == 'Approved')

        {

        window.open("/apex/echosign_dev1__AgreementTemplateProcess?masterid={!Account.Id}&templateId=a08o0000004m8XH ");

        }

4 Kommentare
0/9000