You need to sign in to do that
Don't have an account?
Naganjaneya Lakshman Tadepalli
Question Regarding Triggers Development
In our project there are 2 objects with parent child relationship(Lookup relationship) between ORDER and ORDER DETAILS, in ORDER object there is field called Status having picklist values(New, Processed
and Completed), here the requirment is when ever the status is changed to Processed then an ORDER DETAIL record should be created for the corresponding record in the ORDER object. Can anyone help me with code
to implement the trigger of above scenario?
and Completed), here the requirment is when ever the status is changed to Processed then an ORDER DETAIL record should be created for the corresponding record in the ORDER object. Can anyone help me with code
to implement the trigger of above scenario?
list<OrderList> ordlist=new list<OrderList>();
for(Order ord:[SELECT id,status From Order WHERE status='Processed' and Id =:Trigger.New]{
OrderDetail orddtl=new OrderDetail();
orddtl.Name=ord.Name;
ordlist.add(orddtl);
//Try to map all mandatory fields in child object here
}
insert ordlist ;
}
}