Removed nullifying OpportunityLineitem.UnitPrice on clone.

This commit is contained in:
Christopher Gary committed 2021-07-08 17:08:51 -04:00
1 parent e16023a4af
commit db80663afb
1 file changed
+4
@@ -6,6 +6,8 @@
* @group Opportunity Cloning
* @history 2021-04-02 - CJG - Created
* 2021-04-12 - CJG - Added setting to restrict child records shown to a particular List
* 2021-07-08 - CJG - removed functionality to clear out OpportunityLineItem.UnitPrice in
* order to insert OpportunityLineItems.
*/
public with sharing class OpportunityCloneService {
/**
@@ -187,9 +189,11 @@ public with sharing class OpportunityCloneService {
for(SObject rec:recList){
SObject newRec = rec.clone(false,true,false,false);
newRec.put(parentFieldName, newParentId);
/**
if(newRec.getSObjectType().getDescribe().getName().toUpperCase() == 'OPPORTUNITYLINEITEM') {
newRec.put('UnitPrice',null);
}
*/
newList.add(newRec);
}
return newList;