You need to sign in to do that
Don't have an account?

Trigger for creating automatically creating an invoice when an opportunity is created with amount field filled.
I need help in creating a trigger which can automatically generate an invoice when an opportunity is created with the amount field filled.
All Answers
http://www.sfdc99.com/beginner-tutorials/
http://forceschool.blogspot.in/search/label/Apex%20Triggers
If you face any issues let me know.
Thanks
Shashikant
Hi Yogesh
I have created this trigger.Could you please check and let me know what is the error here. Please bear with me as I am new to triggers. Thanks.
trigger invoiceGenerate on Opportunity (before insert) {
List<Invoice1__c> invoiceList = new List<Invoice1__c>();
for(opportunity opp:trigger.new){
if(opp.Amount==0){
Invoice1__c in= new Invoice1__c(Name='TestInvoice');
invoiceList.add(in);
}
}
insert invoiceList;
}
Invoice1__c in= new Invoice1__c(Name='TestInvoice');
in this line it says a semicolon expected but found in. I don't get why it is giving this error.