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
Bryan PaldinoBryan Paldino 

Custom Accept Button

Hi Everyone,
I am trying to create my own custom Accept button.  Must of the JavaScript code is working, but I can not figure out how  to identify what record is selected in the Queue.   Has anyone done this?

Here's the code that I have so far.
 {!REQUIRESCRIPT("/soap/ajax/31.0/connection.js")}

try{


    var changeRequestToUpdate = new sforce.SObject("Underwriting__c");

    changeRequestToUpdate.Id = "{!Underwriting__c.Id}";
    changeRequestToUpdate.OwnerId = "{!$User.Id}";
    changeRequestToUpdate.Status__c = "In Progress";

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

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

Thanks
Angelina MuddamalleAngelina Muddamalle
the following link might be useful: https://salesforce.stackexchange.com/questions/167037/accept-button-on-lead-detail-page