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
VNVN 

Invoking Apex class using s-control

Hi,
 
I have an apex class called accountdetail. I want to access this apex class using s-control. This is the piece of code that iam using.
 

var account = sforce.sObject("Account");
var accounts = sforce.apex.execute("accountdetail", "getAccount", {});
alert(accounts.Name);
sforce.debug.trace=true;

here getAccount is the method in apex class accountdetail.

I have added this s-control in Accounts page and its giving me an an alert as 'undefined'.

Is this correct? I want to fetch the records stored in accounts.
Please tell me how to do it.
 
Thanks in advance
Priya Nair

cheenathcheenath
Your code looks good,

Try

alert(accounts);

See what you get for this.


tmactmac

Hi I am new to Salesforce and I was told that in order to accomplish one of my tasks I need to use s-control.  I admit I have read the literature and I am still not 100% sure that I need to use s-control to accomplish what I want to accomplish.  This is what I am trying to do:

I want to put the NAICS code in an account record, but I want that same NAICS code to map over to any opportunity that is associated with that account.  Is this done with s-controls?  If so can you offer any suggestions?  I am pretty lost.

Thanks in advance.