+ Start a Discussion
Osiris77706Osiris77706 

Problem with Custom Object in an apex trigger

     Im new to salesforce, and my company recently installed a new package from the appexchange called "project and issue management" the package came with some custom objects, one in particular is the "project" object, which I am trying to write a trigger for, but it seems that for some reason the object is not recognized.  the following very simple code errors out:

 

trigger ProjectAutoFill on SFDC_Project__c (before insert) {

SFDC_Project_c tempProject;

}

 

the error is:

 

Error: Compile Error: Invalid type: SFDC_Project_c at line 3 column 1

If anybody could help me understand what's going on here it would be greatly appreciated

Best Answer chosen by Admin (Salesforce Developers) 
jhenningjhenning

osiris77706, looks like you are missing an underscore char in the line in which you are defining the tempProject variable. It should be:

 

SFDC_Project__c tempProject;

All Answers

jhenningjhenning

osiris77706, looks like you are missing an underscore char in the line in which you are defining the tempProject variable. It should be:

 

SFDC_Project__c tempProject;

This was selected as the best answer
Osiris77706Osiris77706

Wow ! thank you so much. ha i can't believe i didnt see that. in my defense, two underscores in a row, in an object name seems like a bad practice =p.