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
dasydasy 

send function from javascript to controller

I sent function from my script to the controller  with:  force.apex.execute metod of apex,

 

but the function doesn't do the request.

 

I will be happy to heard from someone somthing about that point

 

Pradeep_NavatarPradeep_Navatar

Try the sample code given below :

 

            function timedisp()

                                                {

                                                                sforce.connection.sessionId="{!$Api.Session_ID}";

                                                                var gettime=sforce.apex.execute("timeclass","getCalTime",{});

                                                                alert(gettime);

                                                                document.getElementById("j_id0:j_id2:opnl").innerHTML='<b>' + gettime + '</b>';

                                                }

                                                where timeClass is global clss and getCalTime is the web service method.

 

Did this answer your question? if so, please mark it solved.