{!IF( {!AND(Legal_Contract__c.Parent_Company_LC__c = "Company A", Legal_Contract__c.Approval_Status_LC__c = "Approved")}, URLFOR("/apex/dsfs__DocuSign_CreateEnvelope",null, [sId=Legal_Contract__c.Id,ecId="a1Kn0000000AMMAEA4"]),
{!IF( {!AND(Legal_Contract__c.Parent_Company_LC__c = "Company B", Legal_Contract__c.Approval_Status_LC__c = "Approved")}, URLFOR("/apex/dsfs__DocuSign_CreateEnvelope",null, [sId=Legal_Contract__c.Id,ecId="a1Kn0000000AMM9EAO"]),
null
)})}
2 Questions:
- Getting a syntax error, but not sure why.
- How do I stop this button from working if it doesn't meet the condition? I put the null in there, but now sure if that will do the trick. It would be nice to have a popup or alert message explaining why, but don't think that is possible in lightning.
Updated code, which addresses question 1. Question 2 still an issue:
{!IF(
AND(Legal_Contract__c.Parent_Company_LC__c = "Company A", ISPICKVAL(Legal_Contract__c.Approval_Status_LC__c, "Approved")),
URLFOR ("/apex/dsfs__DocuSign_CreateEnvelope",null, [sId=Legal_Contract__c.Id,ecId="a1Kn0000000AMMAEA4"]),
IF(
AND(Legal_Contract__c.Parent_Company_LC__c = "Company B", ISPICKVAL(Legal_Contract__c.Approval_Status_LC__c, "Approved")),
URLFOR("/apex/dsfs__DocuSign_CreateEnvelope",null, [sId=Legal_Contract__c.Id,ecId="a1Kn0000000AMM9EAO"]),
null))
}