function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Paul TolentinoPaul Tolentino 

How to edit an address in the Invoice created in OnClick JavaSript

How to edit an address in the Invoice created in OnClick JavaSript
AbhishekAbhishek (Salesforce Developers) 
Hi Paul,

Let's try this:
{!REQUIRESCRIPT("/soap/ajax/32.0/connection.js")}

try{

    var equipAssetToUpdate = new sforce.SObject("Equipment_Asset__c");

    equipAssetToUpdate.Id = "{!Equipment_Asset__c.Id}";
    equipAssetToUpdate.Ready_Date__c = new Date();
    equipAssetToUpdate.Ready_For_Sale__c = true;

    var result = sforce.connection.update([equipAssetToUpdate]);

    if(result[0].success === "true"){
        location.reload();
    }
    else{
        alert(
            "An Error has Occurred. Error: " +
            result[0].errors.message
        );
    }
}
catch(e){
    alert(
        "An unexpected Error has Occurred. Error: " + 
        e
    );
}


As of now, we don't have an exact live scenario to suggest to you but please try the above suggestion.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks.