SFDO-Community / declarative-lookup-rollup-summaries

Declarative Lookup Rollup Summaries (DLRS) is a community built and maintained Salesforce application that allows you to create cross object roll-ups declaratively - no code! For install instructions and documentation, visit our website https://sfdo-community-sprints.github.io/DLRS-Documentation/
https://sfdo-community-sprints.github.io/DLRS-Documentation/
BSD 3-Clause "New" or "Revised" License
690 stars 237 forks source link

Developer script exception from Veolia Water Technologies : dlrs_SVMXC_Service_Order_LineTrigger : #1380

Closed Veolia2019 closed 4 months ago

Veolia2019 commented 1 year ago

Hi Team, I received the below Developer exception from DLRS Package Code. Developer script exception from Veolia Water Technologies : dlrs_SVMXC_Service_Order_LineTrigger : dlrs_SVMXC_Service_Order_LineTrigger: execution of AfterInsert caused by: System.DmlException: Upsert failed. First exception on row 0; first error: DUPLICATE_VALUE, doppelten Wert gefunden: dlrsQualifiedParentIDc ist ein Duplikat des Werts im Datensatz mit folgender ID: a3n5J000000ypld: [] (dlrs) Trigger.dlrs_SVMXC_Service_Order_LineTrigger: line 7, column 1

Apex script unhandled trigger exception by user/organization: 0051t000004O6R9/00D1t000000sUMs

dlrs_SVMXC_Service_Order_LineTrigger: execution of AfterInsert

caused by: System.DmlException: Upsert failed. First exception on row 0; first error: DUPLICATE_VALUE, doppelten Wert gefunden: dlrsQualifiedParentIDc ist ein Duplikat des Werts im Datensatz mit folgender ID: a3n5J000000ypld: []

(dlrs) Trigger.dlrs_SVMXC_Service_Order_LineTrigger: line 7, column 1

We are unable to debug the Code to investigate further.

Could you please help us to find the issue.

sfenton3 commented 1 year ago

In scheduled mode DLRS upserts schedule item records using an external Id field called dlrsQualifiedParentIDc. Salesforce will not allow you to upsert multiple records with the same external Id in the same transaction. It is not too common for this issue to occur because the records need to be upserted in the same batch, but it can happen on heavily used objects.

If you are concerned this is causing bad data I would do a scheduled full calculate nightly.

This Salesforce article goes into the issue in more detail: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_dml_examples_upsert.htm

sfenton3 commented 1 year ago

@aheber I saw we had a issue related to this #375. Is this an active issue we are looking to solve?

Veolia2019 commented 1 year ago

Hi Team,

Yes, it's the same issue as DLRS throwing Qualified Parent ID duplicate error(#375).

Thanks and Regards, Rajiv Thanneru Upcoming Out Of Office - 14th & 15th Aug

On Thu, 10 Aug 2023 at 02:57, Scott Fenton @.***> wrote:

@aheber https://github.com/aheber I saw we had a issue related to this

375

https://github.com/SFDO-Community/declarative-lookup-rollup-summaries/issues/375. Is this an active issue we are looking to solve?

— Reply to this email directly, view it on GitHub https://github.com/SFDO-Community/declarative-lookup-rollup-summaries/issues/1380#issuecomment-1672378489, or unsubscribe https://github.com/notifications/unsubscribe-auth/BBZ52YJV3DCVXPJ5K5QVS53XUQWXBANCNFSM6AAAAAA3JQXAM4 . You are receiving this because you authored the thread.Message ID: <SFDO-Community/declarative-lookup-rollup-summaries/issues/1380/1672378489 @github.com>

--

The information in this email and any associated files is confidential to Veolia Water Technologies (SASU) and/or any affiliate thereof and may be legally privileged. For the herein purposes, “affiliate” means any legal entity, partnership, joint venture, equity, company, including in particular any and all subsidiary which, directly or indirectly, controls Veolia Water Technologies (SASU) and/or is under the control thereof and/or is under the control of the ultimate parent company thereof, and “control” means the ability to directly or indirectly, direct the affairs of a third party by means of ownership, contract or otherwise. It may also contain information that is subject to copyright or constitutes a trade secret. It is intended solely for the named recipient. Access to this email by anyone else is unauthorized.

If you are not the intended recipient, please note that any use, disclosure, copying, distribution of this email or any action taken or omitted to be taken in reliance on its prohibited.

Warning: Although this email and any attachment thereto are believed to be free from viruses, it is the responsibility of the recipient to ensure that they are virus free. No responsibility whatsoever is accepted by Veolia for any loss or damage arising from their receipt or opening.

aheber commented 4 months ago

Closing as a duplicate of #375