This solution serves to remove line items from an Opportunity record using a CSV import.
Note: Always perform test CSV imports for a few records before performing the actual CSV Import for all target records. CSV import changes are non-reversible.
1. Create a CSV file that you can generate from a Saved Search with these columns:
- Internal ID of Opportunity record
- Internal ID of the Item records that will remain after the import
2. Navigate to Setup > Import/Export > Import CSV Records.
3. Under Import Assistant, set:
- Import Type = Transactions
- Record Type = Opportunity
5. Set Data handling to Update.
6. Under Advanced Options, mark the Overwrite Sublists checkbox.
7. Click Next.
8. Set the following Field Mapping:
- Internal ID = Internal ID
- Items (set to Internal ID) = Items: Item
Note: Click the pencil icon on next to Items and set Choose Reference Type to Internal ID9. Click Next.
10. Set Import Map Name.
10. Click Save & Run.
Result: The items whose Internal ID were not included in the CSV file are removed from the Opportunity records.