Skip to content

Instantly share code, notes, and snippets.

@jimmydivvy
Created November 29, 2011 07:09
Show Gist options
  • Save jimmydivvy/1403817 to your computer and use it in GitHub Desktop.
Save jimmydivvy/1403817 to your computer and use it in GitHub Desktop.
Auto create sales order
trigger Auto_Create_Sale on biz3__Order__c (after insert) {
if( Trigger.new.size() == 1 ){
biz3__Order__c order = Trigger.new[0];
biz3__Sales_Order__c so = new biz3__Sales_Order__c();
so.biz3__Contact__c = order.biz3__Contact__c;
so.biz3__Order__c = order.Id;
insert so;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment