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
vijayakumar Bvijayakumar B 

writing triggers in eclipse

Hi friends,
   Could any one of you help  me to run trigger in eclipse?
i Just connected eclipse to salesforce org and i witten this trigger;>>>>>>



trigger limitrow11 on Candidate__c (before insert) {


integer x=0;

List<Candidate__c> Candidatelname = [select First_Name__c

              from Candidate__c];


x=Candidatelname.size();
for ( Candidate__c candInLoop : Trigger.new) {
if(x>=20){
candInLoop.adderror('exceeded');
}
}

}

now im  not able to rub this trigger and it is giving me a error message like  "unable to open apex editor and null argumment"..
logontokartiklogontokartik
You cannot run a trigger from Eclipse. You need to deploy the code to the Salesforce instance and test it over there by simulating inserting a record into Candidate object. 

Please go through Apex workbook to understand more.

https://developer.salesforce.com/docs/atlas.en-us.apex_workbook.meta/apex_workbook/apex_trigger_1.htm