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
newbie101newbie101 

Qs on Button to execute Apex Code

I have seen the cookbook sample on how to add JS code to invoke an apex WebService method.

 

Now my question is :-

 

1.      Can I not just have a custom button / override a standard button (if either of these two is possible), and then

       have it execute APEX code, just like a trigger ?

            Why does it have to be a webservice call.

 

2.      In the JavaScript/WebService example, does the JavaScript run on the client browser ?

                 What if I am running on a mobile device ?

 

Thanks