LoginSignup
0
0

DLRL での重複値エラー

Last updated at Posted at 2023-08-21

解決済事例

Turns out the field the rollup was built to change had been deleted. Presumably, recreating that field could solve the problem, but in my case, I just deactivated the rollup.

変更するためにロールアップが構築されたフィールドが削除されていたことがわかりました。おそらく、そのフィールドを再作成すると問題が解決する可能性がありますが、私の場合はロールアップを非アクティブ化しただけです。

Insert failed. First exception on row 0; first error: CANNOT_EXECUTE_FLOW_TRIGGER, We can't save this record because the “Update Opportunity and Payment Related to Transaction” process failed. Give your Salesforce admin these details. This error occurred when the flow tried to update records: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: dlrs_OpportunityTrigger: execution of AfterUpdate

caused by: System.DmlException: Upsert failed. First exception on row 0; first error: DUPLICATE_VALUE, duplicate value found: dlrs__QualifiedParentID__c duplicates value on record with id: a14Nq00000JmAEpIAN: []

I think you've already figured out this is an access problem related to Guest users.

This has come up from time to time when a rollup is set to "Scheduled" mode. There is a trigger on the child object that, when it sees something that might cause the rollup to need to be recalculated, will create a LookupRollupSummaryScheduleItems__c record to enqueue the rollup for later processing.

These are in part uniquely tracked via the QualifiedParentID__c field. When the Guest user tries to insert a record, if another record already exists with that same ID value then the Guest user's insert fails. This is in part because the Guest user doesn't have the security permission to access that object to see the existing record.

The DLRS project needs to make some changes to smooth this out but for now that isn't being actively worked on. Hopefully soon.

In the mean time you can move the rollup to "Process Builder" mode and then schedule Full Recalculations to run on a schedule to true up the parent field. That should help avoid the error until the project team puts together a better long-term resolution.

これがゲスト ユーザーに関連するアクセス問題であることはすでにおわかりかと思います。

この問題は、ロールアップが「スケジュール」モードに設定されている場合に時々発生します。子オブジェクトにはトリガーがあり、ロールアップの再計算が必要になる可能性があるものを検出すると、LookupRollupsummaryScheduleItems__c レコードを作成して、後の処理のためにロールアップをキューに入れます。

これらは、QualifiedParentID__c フィールドを通じて部分的に一意に追跡されます。ゲスト ユーザーがレコードを挿入しようとしたときに、同じ ID 値を持つ別のレコードがすでに存在する場合、ゲスト ユーザーの挿入は失敗します。これは、ゲスト ユーザーがそのオブジェクトにアクセスして既存のレコードを表示するセキュリティ権限を持っていないことが 1 つ理由です。

DLRS プロジェクトはこれをスムーズにするためにいくつかの変更を加える必要がありますが、現時点では積極的に取り組んでいません。うまくいけばすぐに。

未解決事例

Insert failed. First exception on row 0; first error: CANNOT_EXECUTE_FLOW_TRIGGER, We can't save this record because the “Update Opportunity and Payment Related to Transaction” process failed. Give your Salesforce admin these details. This error occurred when the flow tried to update records: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: dlrs_OpportunityTrigger: execution of AfterUpdate

caused by: System.DmlException: Upsert failed. First exception on row 0; first error: DUPLICATE_VALUE, duplicate value found: dlrs__QualifiedParentID__c duplicates value on record with id: a14Nq00000JmAEpIAN: []

これが誰かの役に立つ場合に備えて、認証された Experience Cloud ユーザーに影響を及ぼしていた別の「重複した値が見つかりました: dlrs__QualifiedParentID__c...」エラーのトラブルシューティング中にこの投稿を見つけました。最終的には、ルックアップ ロールアップ サマリー スケジュール アイテム オブジェクトの内部および外部 OWD をパブリック読み取り/書き込みに変更することで、この問題を解決できました。 Public Read-Only を試してみましたが、解決しませんでした。パブリック読み取り/書き込みである必要がありました。

In case this is helpful to someone — I came across this post while troubleshooting another "duplicate value found: dlrs__QualifiedParentID__c..." error that was affecting authenticated Experience Cloud users. Ultimately I was able to resolve it by changing the internal and external OWD on the Lookup Rollup Summary Schedule Item object to Public Read/Write. I tried Public Read-Only and that did not resolve it; it had to be Public Read/Write.

https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007IflS0SAJ

https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000J77JbSAJ

caused by: System.DmlException: Upsert failed. First exception on row 0; first error: DUPLICATE_VALUE, duplicate value found: dlrs__QualifiedParentID__c duplicates value on record with id: a268X00000CKTOW: []

Trigger.dlrs_npe03_Recurring_DonationTrigger: line 7, column 1

私も以下のように思ったけど、無いって回答してますね。

usually this error appears if you are populating a field such as an external id that should have a unique value. I would check your field you're trying to populate with DLRS and make sure that the unique value is not checked in the Object Manager.

通常、このエラーは、一意の値を持つ必要がある外部 ID などのフィールドを入力している場合に表示されます。 DLRS を使用して入力しようとしているフィールドを確認し、オブジェクト マネージャーで一意の値がチェックされていないことを確認します。

以下も似たような質問、 line 7, column 1と同じところでエラーになってます。

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

Trigger.dlrs_SVMXC_Service_Order_LineTrigger: line 7, column 1

以下のように解答したけど、違うらしい

I had the same issue with the Community users and I was able to resolve this by changing the 'Calculation Sharing Mode' to 'System' (from the default user).

'Calculation Sharing Mode' is set to 'System' only in our Configuration and still facing the issues.

Please let us know if any further changes are required.

外部Idが怪しいと思うけど...

dlrs_WorkOrderTrigger: execution of AfterInsert\n\ncaused by: System.DmlException: Insert failed. First exception on row 0; first error: DUPLICATE_VALUE, duplicate value found: dlrs__UniqueName__c duplicates value on record with id: a079r00000DM7RyAAL: []

\n\n(dlrs)\nTrigger.dlrs_WorkOrderTrigger: line 7, column 1

必ずline 7, column 1

Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, dlrs_WorkOrderTrigger: execution of AfterInsert caused by: System.DmlException: Insert failed. First exception on row 0; first error: DUPLICATE_VALUE, duplicate value found: dlrs__UniqueName__c duplicates value on record with id: a079j00000O96GrAAJ: [] (dlrs) Trigger.dlrs_WorkOrderTrigger: line 7, column 1: []

Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, dlrs_TaskTrigger: execution of AfterInsert

caused by: System.DmlException: Insert failed. First exception on row 0; first error: DUPLICATE_VALUE, duplicate value found: dlrs__UniqueName__c duplicates value on record with id: a079j00000O6GiPAAV: Trigger.dlrs_TaskTrigger: line 7, column 1: []

親はCaseかぁ。
image.png

Unable to create work order & task record with guest user

使われていないフィールドが問題か?

dlrs_AccountTrigger: execution of AfterDelete caused by: dlrs.RollupService.RollupValidationException: Scheduled rollups are running in legacy mode and are unable to resolve corresponding shadow rollups. Please visit the Lookup Rollup Summary Tools tab for more information and steps to resolve. (dlrs) Trigger.dlrs_AccountTrigger: line 7, column 1

これも同じことをしたかった?

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0