You need to sign in to do that
Don't have an account?
JSpence
Call Custom Button Onclick event
Hello fellow SFdevs,
Is there a way to call the onclick event code in a custom button via apex from the system log?
Example:
MyObject.MyCustomSubmitButton()
Yes, you can instantiate an apex class and call methods on it - I use that mechanism to apply datafixes from time to time.
All Answers
You won't be able to do that from apex I'm afraid. The custom button side of things is only available via the metadata api.
Can you explain a bit more about what the button does and what you are trying to achieve?
The button does some checks on the object to make sure it is in the right state then calls an enormous apex class with sforce.apex.execute(...). Can you call apex classes through the systemlog?
Yes, you can instantiate an apex class and call methods on it - I use that mechanism to apply datafixes from time to time.