You need to sign in to do that
Don't have an account?
Linda 98
Missing argument,Id not specified in an update call.
I have a trigger to create a child, sub child records when status is changed.
like. Opportunity with line items and when status changed then create customobject__c and its line items.
Everything works fine till here.
but when a field on opportunity line items called as 'numberoflines' is updated, I am trying to update 'totallines' field on customobject line items object
I created a trigger on Opplineitems,which when changed,have to update totallines field onn customobjectlineitems.
What am I doing wrong?
I used opportunity, opportunity line items as examples as it explains relations.Thank you
like. Opportunity with line items and when status changed then create customobject__c and its line items.
Everything works fine till here.
but when a field on opportunity line items called as 'numberoflines' is updated, I am trying to update 'totallines' field on customobject line items object
I created a trigger on Opplineitems,which when changed,have to update totallines field onn customobjectlineitems.
trigger totallineupdate on Opplineitem (before update) { Map<id,customobjectlineitem__c> newMap =new Map<id,customobjectlineitem__c>(); for(Opplineitem Oli :trigger.new) { Opplineitem oldLi = Trigger.oldMap.get(Oli.id); if(Oli.Numberoflines != OldFL.Numberoflines){ customobjectlineitem__c Coli =new customobjectlineitem__c(Opportunity__c=oli.Opportunity__c,Totallines=oLI.numberoflines); newMap.put(OLI.Opportunity__c,coli); } } update newMap.values(); //id not specifed error here }
What am I doing wrong?
I used opportunity, opportunity line items as examples as it explains relations.Thank you
Raj Vakati
Try ilke this ..