From db80663afbf328c4325227f2e3702fc006d02cda Mon Sep 17 00:00:00 2001 From: Christopher Gary Date: Thu, 8 Jul 2021 17:08:51 -0400 Subject: [PATCH] Removed nullifying OpportunityLineitem.UnitPrice on clone. --- force-app/main/default/classes/OpportunityCloneService.cls | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/force-app/main/default/classes/OpportunityCloneService.cls b/force-app/main/default/classes/OpportunityCloneService.cls index 1e191fa..cd33ed8 100644 --- a/force-app/main/default/classes/OpportunityCloneService.cls +++ b/force-app/main/default/classes/OpportunityCloneService.cls @@ -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;