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
AmansAmans 

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",

{a:"Smith",

b:account});

But not able to get for triggers from S-control

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

sdudasduda
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.