You need to sign in to do that
Don't have an account?
Sales Force FRM
How to invoke trigger on custom object
Hi Folks,
I have created a custom object say "ABC" (App Setup-->create-->Objects) and i want to invoke a trigger on this ,How to do this, suggestions welcome. My trigger on custom object "ABC" is as follows:
trigger ARPTrigger on ABC(after insert) {
}
The above one generated following error:
Error: Compile Error: Invalid SObject type name: ABC at line 1 column 23
Regards,
Rajeshwar.
I have created a custom object say "ABC" (App Setup-->create-->Objects) and i want to invoke a trigger on this ,How to do this, suggestions welcome. My trigger on custom object "ABC" is as follows:
trigger ARPTrigger on ABC(after insert) {
}
The above one generated following error:
Error: Compile Error: Invalid SObject type name: ABC at line 1 column 23
Regards,
Rajeshwar.
Hi Rajeshwar,
I guess it should work. Please follow any one the below steps if you were not following.
1) Click Create--->Objects--->Then click the Custom Object Label.
You will be taken to the custom object overview page. There you will find a section called Triggers some where in the middle.
There you try to create the Trigger with the same code by clicking the New button. I checked just now and its working.
2) If you are using Eclipse, then right click on the project name or any of the folder. There you will be given an option to create Trigger. Follow the steps in the wizard.
I hope this will resolve your problem.
Thanks,
OnDemand
Message Edited by OnDem Dev on 05-28-2008 04:20 AM
When referencing custom objects from Apex Code, the Web Services API, or SOQL, you must use the object's developer name, which includes the suffix "__c". So try creating your trigger on "ABC__c" and it should work.
Jon
Yes i have done the same and its working for me.
Please check that and redo the steps which i provided.
Thanks,
OnDemand
Trigger t on Country__c (before insert, before update) {
Country__c[] countries = Trigger.new;
HelloWorldForce.addHelloWorld(countries);
}
Error: Compile Error: Incorrect SObject type: Country__c should be Account at line 1 column 1