You need to sign in to do that
Don't have an account?
Benedict Yeo 6
Clone Order Line Items into custom object
I've just started using Apex, and am trying to get the Line Items in Orders to reflect into a custom object Collection when a new Collection record is created. I've created another object called Collection Item as well.
However, I really can't get it to work.. Is there anyone who can point me in the correct direction? Thanks!
However, I really can't get it to work.. Is there anyone who can point me in the correct direction? Thanks!
Below code is a basic one to create a record in a custom object when a record in inserted in a standard object:
trigger statusUpdate on OpportinityLineItem (after insert)
{ List<Comms__c> commlist = new List<Comms__c>();
for(OpportinityLineItem a : trigger.new)
{ Comms__c comm = new Comms__c ();
comm.Name = 'testName';
commlist.add(comm); }
insert commlist;
}