function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
vfexp41vfexp41 

Clone Opportunity line items

HI,

             i am planning to clone the opportunity line items. in opportunity  i have 1 opportunitylineitem record, when i created new opportunityline item at that case i have to change the old opportunityline item status to close and i have to copy the old record values(price,discount,amount) to newly created  record. how can i achieve it.
Ankit AroraAnkit Arora
For line item clone you've to clone Pricebook entry too, and make sure the new opportunity have same pricebook assigned. I think this is simple via code. Also when you case, is that opportuntiy? Or native case object?
vfexp41vfexp41
@Ankit

          can you some sample code for this, 

                  i have to clone only opportunitylineltems and  i have to store  lineitems in same opportunity.