You need to sign in to do that
Don't have an account?
noukasmaximus
How do I display an hourglass or 'please wait' message while my Apex class is processing?
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?
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?
This also leaves you room to expand, as I assume you want to do more than that. You can have a message text field on that custom setting, where you can store errors, status codes, messages etc. to display on the page and return it via remoting, you can rerender the page or append return data back via javascript remoting.
That's my take based on what I assume to be the challenge you are facing, hope it helps.
--KC
I don't want to put the code in the custom button as there are already validation rules that fire off the button and display messages, so it would be strange to have one of those rules fire and the 'please wait' fire. That is what I experienced when I tested code in the button for this purpose.
So it seems the best place for the code is the APEX, I'm just stumped on how to make it work.
The APEX currently refreshes the salesforce browser when it is complete, if that helps.