Forum Replies Created

  • surbhi

    Member
    July 23, 2022 at 5:15 AM in reply to: Custom Button "OnClick JavaScript" stopped working

    As an addendum to Ilya's clever response, I thing a decent approach to getting lucidity in the in the Java event that assertion is to eliminate a portion of the limiting rationale and assess it earlier.
    What I'd typically do if my on the off chance that assertion was getting hard to comprehend is either utilize a capability to assess the articulation - ie:
    if( isCreditedInvoice())
    Or on the other hand (more probable for this situation):
    var isInvoice = "{!Animal__c.RecordType}" == "2 - Invoice" ? valid : bogus;
    var isCredited = "{!Animal__c.Invoice_Status__c}" == "Credited" ? valid : bogus;
    Then you can compose the wonderful clear assertion:
    on the off chance that (isInvoice && isCredited){
    //do stuff
    }
    What's more, obviously, you could attempt this choice as well:
    var recordType = "{!Animal__c.RecordType}";
    var invoiceStatus = "{!Animal__c.Invoice_Status__c}";
    You proclamation will seem to be this:
    if (recordType == "2 - Invoice" && invoiceStatus == "Credited"){
    //do stuff
    }
    At any rate, this is just trying to say that assuming you dynamic away a portion of the stray pieces, you can make your occupation more straightforward.

Popular Salesforce Blogs

Popular Salesforce Videos