You need to sign in to do that
Don't have an account?
ces
Injecting javascript in apex trigger
Hi,
I'm a newbie in APEX. I would like to ask if it's possible to add a javascript inside a trigger. Say for example, I want to add a javascript alert() when the save button of Account is clicked. Is this possible? If it is, can you share me some examples?
Your help will be greatly appreciated.
Thanks a lot,
Ces
I'm a newbie in APEX. I would like to ask if it's possible to add a javascript inside a trigger. Say for example, I want to add a javascript alert() when the save button of Account is clicked. Is this possible? If it is, can you share me some examples?
Your help will be greatly appreciated.
Thanks a lot,
Ces
apex code execute on server side and java script execute on client side.
so it's not possible to add javascript in apex code.
Thanks
Ajit
As was mentioned above, there is no way to do this with a server side trigger, it doesn't interact directly with the UI when executed anyway. You should look into adding an scontrol on the page to perform your desired functions.
Check the online help for "Useful S-Controls"
If you want to add a alert() message when the form is submited , you can do it with the onclick event of the apex:commandbutton tag.
Take a look at the different apex components attributes at :
https://na1.salesforce.com/apexpages/apexcomponents.apexp
Br1.
Anyway, thanks a lot! Got to find a new way to do this. :)