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.

  • The profile that you are deleting the data with, did you make sure that it has Modify all Data permission for the QLI object? – Khushboo Dua Dec 5 '18 at 12:05
  • is there any delete trigger on QLI ? – rahul gawale Dec 5 '18 at 16:40
  • @KhushbooDua - Modify All Data is checked for Quotes (there isn't an option to set it for QuoteLineItems in Profile Settings). The same is true for Opportunities and OpportunityLineItems, respectively. – KB145 Dec 5 '18 at 19:54
  • @rahulgawale - No, there aren't any triggers that fire in delete for QLIs (or Quotes). – KB145 Dec 5 '18 at 19:54
  • I had a similar issue with Order, this might help – cropredy Dec 7 '18 at 0:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.