• noukasmaximus
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies
I have a custom button which I've placed on a standard layout.

It has javacript in it that calls an Apex class.

In the javascript I am disabling the button onclick.

But the Apex class can take up to 50 seconds to process, and during that time, I'd like to display an hourglass or 'please wait' message.  (The class is creating a bug in our JIRA system used by our RND team and using some complex formulas to set component, fix version, and assignee, so it takes some times to process.)

I believe I need to place this code in the Apex class.  All I can find is how to do it in a Visual Force page using the actionStatus function, but that doesn't apply here.

How do I do this?

We have a custom button that executes JavaScript on our case record:

{!REQUIRESCRIPT("/soap/ajax/14.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/14.0/apex.js")}
this.disabled=true;
try{
var accId='{!Account.Id}';
var objectId = '{!Case.Id}';

var result = sforce.apex.execute("ForceJiraComm", "createIssue",
{case_id : objectId});
alert(result);
location = location;
}
catch(err) {
txt="There was an error on this page.\n\n";
txt+="Error description: " + err + "\n\n";
txt+="Click OK to continue.\n\n";
alert(txt);
}
this.removeAttribute('disabled');

We want it to also write the full name of the user that clicked the button to the custom field JIRA_Escalated_By__c on the case object.  How do we do this?

Basically, how can update our APEX to store who clicks a custom button?”

I have a custom button which I've placed on a standard layout.

It has javacript in it that calls an Apex class.

In the javascript I am disabling the button onclick.

But the Apex class can take up to 50 seconds to process, and during that time, I'd like to display an hourglass or 'please wait' message.  (The class is creating a bug in our JIRA system used by our RND team and using some complex formulas to set component, fix version, and assignee, so it takes some times to process.)

I believe I need to place this code in the Apex class.  All I can find is how to do it in a Visual Force page using the actionStatus function, but that doesn't apply here.

How do I do this?

We have a custom button that executes JavaScript on our case record:

{!REQUIRESCRIPT("/soap/ajax/14.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/14.0/apex.js")}
this.disabled=true;
try{
var accId='{!Account.Id}';
var objectId = '{!Case.Id}';

var result = sforce.apex.execute("ForceJiraComm", "createIssue",
{case_id : objectId});
alert(result);
location = location;
}
catch(err) {
txt="There was an error on this page.\n\n";
txt+="Error description: " + err + "\n\n";
txt+="Click OK to continue.\n\n";
alert(txt);
}
this.removeAttribute('disabled');

We want it to also write the full name of the user that clicked the button to the custom field JIRA_Escalated_By__c on the case object.  How do we do this?

Basically, how can update our APEX to store who clicks a custom button?”