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
VineetaVineeta 

Can we use apex code language script code within SControl...

Hi Friends

I don't have much idea about S-Controls,I would like to know can we use Apex code language method within S-Controls to avoid an API call?

Is there any limitation or so?can u suggest any gud link to learn more about S-Controls.

Vineeta
sdudasduda
No, however you can define an APEX class method as a webservice. Once defined as a webservice, you can use the javascript API to call that method.

Here is an example of how to call the APEX code method from javascript. For more information, you can look at the APEX language reference.

Code:
var actions = sforce.apex.execute("myApexClass","someMethod",{
a: param
})

 

Anand SinghAnand Singh

Hi,

To call apex webservice methods,you need to include the apex source in javascript as follows:

<script src="/soap/ajax/10.0/apex.js"></script>

Regards,

Anand

 

sanjumehsanjumeh
Hi Vineeta,

#1. Create an APEX Code, declare it as a Webservice and call it from an SControl as defined by sduda.
#2. Since the approach is multitenant, there are limitations on the number of queries that you can make and resources that you can consume in your APEX code.

For additional details please refer to the WIKI page and download the "salesforce_apex_language_reference(winter08).pdf". For limitations look at the "Governors" section in the PDF.
Hope this helps.

Let me know if you need further details with coding aspect.

Regards,
Sanjeev Mehta
sanjumehsanjumeh
The latest PDF on the block is "salesforce_apex_language_reference(spring08).pdf"

Regards,
Sanjeev Mehta