You need to sign in to do that
Don't have an account?
khushbu
Create Trigger dynamically
Hello ,
I want to create trigger dynamically.
Basically my requirement is :
I am creating custome objects dynamically throgh metadata services.
Now whenever my new CO done, my trigger should also be created dynamically.
Please help me out
Not possible
We are writing the triggers for Auto mate the process.
You want any dynamic functionality in your org then you can go with the trigger.
How can you create Triggers Dynamically.....
We need to create triggers Manually....
Ya ..Thats true.
But I am dynamically creating my custom object.
Is there any API for this ?
For creating custom objects , I have used metadata service API.
Any other API for creating same thing with trigger?
They have given this code for this in metadataService :
public class ApexTrigger {
public Double apiVersion;
public MetadataService.PackageVersion[] packageVersions;
public String status;
private String[] apiVersion_type_info = new String[]{'apiVersion','http://www.w3.org/2001/XMLSchema','double','1','1','false'};
private String[] packageVersions_type_info = new String[]{'packageVersions','http://soap.sforce.com/2006/04/metadata','PackageVersion','0','-1','false'};
private String[] status_type_info = new String[]{'status','http://soap.sforce.com/2006/04/metadata','ApexCodeUnitStatus','1','1','false'};
private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'};
private String[] field_order_type_info = new String[]{'apiVersion','packageVersions','status'};
}
But they have not provided any example...how to use it...
What you think?
It will work?
I am having no idea for this API too..
oh i haven't worked on webservices..
This link might be helpful for you
http://salesforce.stackexchange.com/questions/9603/how-do-i-use-the-tooling-api-to-create-a-new-apex-trigger
Thanks
Interesting... do update here if you happen to achieve this.
Ya Sure..
http://www.salesforce.com/us/developer/docs/api_tooling/index_Left.htm#StartTopic=Content/sforce_api_objects_apextriggermember.htm