+ Start a Discussion

Calling Triggers through S-Control

Hey Freinds ,
How can we call triggers  in Apex code from our S-Control
I have tried to figure out  by trying  for Apex class and my  javascript code
global class myClass {

webService static Id makeContact(String lastName, Account a) {

Contact c = new Contact(LastName = lastName, AccountId = a.Id);

return c.id;



Ajax code

var account = sforce.SObject("Account");

var id = sforce.apex.execute("myClass","makeContact",



But not able to get for triggers from S-control

Message Edited by Amans on 09-19-2007 05:46 AM

A trigger won't be fired until an object is inserted, updated or deleted ( depending on how the trigger is defined for the object ). You can't explicitly call the trigger from an s-control - that wouldn’t make any sense. However, if you insert/update/delete and object from your s-control using the API, all associated triggers will be fired in response.