17 QuoteLineItem records were loaded into the org via Dataloader with the incorrect product2id listed.
When trying to delete the records in the GUI while logged in as a System Administrator, the following error message is received:
"There's a problem saving this record. You might not have permission to edit it, or it might have been deleted or archived. Contact your administrator for help."
When trying to delete the records through execute anonymous Apex in the developer console while logged in as a System Administrator, the following error message is received:
"Line: 1, Column: 1 System.DmlException: Delete failed. First exception on row 0 with id ... first error: INSUFFICIENT_ACCESS_OR_READONLY, insufficient access rights on object id: "
Things already verified:
(Note: QLI = QuoteLineItem)
- The QLIs can be viewed in the GUI ("not deleted") and isDeleted is set to false. They don't appear to have an "archived" option according to the Salesforce SOAP documentation. The Quotes they belong to are similarly not deleted, nor do they appear to have an "archived" option.
- The Product2Ids and PricebookEntryIds associated with the QLI are not inactive or archived.
- The Quotes do have the correct Pricebook2Id.
- Deletion was always attempted using the System Administrator profile, it was verified that all fields on Quote, QuoteLineItem, Opportunity, and OpportunityLineItem were viewable and editable by this profile (except for those that cannot be edited regardless of the permissions, obviously).
- The Quotes are in "Draft" status.
- On the one QLI record I'm focusing my testing on for now (after earlier spot checks), there is not a OpportunityLineItemId populated, nor is there an OpportunityId populated on the Quote - therefore the record also does not have IsSyncing set to true.
- The Quotes of the QLIs that can't be deleted appear to be owned by various users, with different profiles and roles (so it doesn't appear to be related to ownership / sharing rules per se).
- There were other QLIs loaded with incorrect product2ids in the same batch that could be successfully deleted.
- Tried setting IsDeleted to true on the record via the Query Editor Developer Console while logged in as a System Administrator, it wouldn't allow the box to be checked at all (let alone saved that way).
- Tried deleting the records through Dataloader while logged in as a System Administrator, the same error was received that was thrown when trying to delete through the developer console.
I would really appreciate any help with figuring out why these cannot be deleted, and how to go about changing that.