ฉันไม่สามารถหาวิธีแก้ปัญหาสำหรับตัวสร้างกระบวนการ - ข้อผิดพลาดการจัดการซ้ำทำงานได้

Aug 19 2020

มีข้อบกพร่องที่น่าหงุดหงิดอย่างไม่น่าเชื่อเกี่ยวกับความขัดแย้งระหว่างตัวสร้างกระบวนการและการจัดการที่ซ้ำกัน

มีบางคนแนะนำวิธีแก้ปัญหา แต่ฉันไม่สามารถใช้งานได้ความขัดแย้งยังคงเกิดขึ้นกับฉัน

นี่เป็นวิธีแก้ปัญหาขอบคุณ Yi-Hs Tsai และ Manu Devaraju:

For those looking for a work around to this very annoying problem, here's a solution that I've found works:

Create a checkbox field on the object called "Allow duplicates?" with default set to false.
In your Duplicate rule definition, include this new field under the "Conditions" section.
In your flow or process builder, BEFORE you update the record, first do an update where you set the "Allow duplicates?" field to true.  Then perform the update you want.
Since "Allow duplicates?" is checked and the update no longer meets the rule conditions, so shouldn't trigger the duplicate rule.
If you want the duplicate rule to run in the future for this record, you can do another record update to uncheck the "Allow duplicates?" field.

For instance, I have a duplicate rule on Contacts that has a whole bunch of matching criteria.  Following the steps I:

Create a field on the Contact object called "Allow Duplicates?" with default unchecked.
In my duplicate rule (Setup -> quickfind -> Duplicate Rules), I set a condition: "Contact: Allow Duplicates? EQUALS False"
In my flow, I have a step where I set Allow Duplicates? = true and update my record.
In my flow, then I perform the update on the email, phone, etc., that ordinarily would trigger the rule because of the my matching criteria.
In my flow, when I'm all done, I set the Allow Duplicates? back to false.

มีคนอื่น (Daniel DeAguilar) มีข้อมูลเพิ่มเติมเกี่ยวกับสิ่งนี้:

So what i did was created the allow duplicates checkbox Yi-Hs mentions on my Account object (default unchecked), and in process builder did the following steps:

Under 'Choose Object and Specify When to Start the Process' i had recursion enabled (this was key)
1st node in process was looking for whenever my parent account field was changed
Immediate action in 1st node was changing duplicate checkbox to 'checked/true'
instead of stop i had 'evaluate next criteria' and go to 2nd node'
2nd node looked for when duplicate checkbox = true/checked
immediate action #1 to set parent account lookup to parent account id field (enabling lookup related lists)
immediate action #2 to set duplicate checkbox = false/unchecked

ในบันทึกการดีบักฉันเห็นว่ากระบวนการกำลังทำงานอยู่และหลังจากนั้นการตรวจหารายการซ้ำจะทำงานและทุกอย่างก็เรียบร้อยฟิลด์ที่กำหนดเองใหม่จะมีค่าที่เหมาะสมและการตรวจจับจะถูกป้องกัน

แต่หลังจากนั้นการประมวลผลเพิ่มเติมก็ดำเนินต่อไปและการตรวจจับซ้ำจะทำงานอีกครั้งและคราวนี้ฟิลด์ที่กำหนดเองใหม่มีค่าเริ่มต้นดังนั้นจึงไม่ป้องกันการตรวจจับและคุณได้รับข้อผิดพลาด DUPLICATES_DETECTED ซึ่งกระบวนการไม่สามารถจัดการได้

สิ่งที่น่าประหลาดใจที่สุดสำหรับฉันคือต้องอัปเดตช่อง "อนุญาตให้มีการซ้ำกัน" อย่างไร ตัวสร้างกระบวนการไม่มีคำสั่ง / ตัวเลือก Update อย่างชัดเจน

นี่คือภาพหน้าจอของการกำหนดค่าตัวสร้างกระบวนการของฉัน:

คำตอบ

2 KrisGoncalves Aug 19 2020 at 20:58

มองลึกลงไปในความคิดเห็นเกี่ยวกับแนวคิดนั้นเพื่อดูความคิดเห็น / วิธีแก้ปัญหาดั้งเดิมโดย Manu Devaraju อธิบายสิ่งนี้ได้ดีกว่ามาก ด้านล่างนี้คือขั้นตอนการคัดลอก / วาง

  1. สร้างฟิลด์รายการเลือกใหม่ 'แทนที่รายการที่ซ้ำกัน' (ใช่ / ไม่ใช่) บนวัตถุผู้ติดต่อ

  2. สร้างกฎการจับคู่สำหรับการรวมกันของชื่อนามสกุลและหมายเลขโทรศัพท์

  3. สร้างกฎซ้ำด้วยกฎการจับคู่ที่สร้างในขั้นตอนข้างต้นก. ในกฎที่ซ้ำกันให้มองหาส่วนด้านล่างและในเกณฑ์จะเพิ่มฟิลด์ 'Override Duplicate' และค่าเป็น 'No' b เงื่อนไขข้างต้นหมายความว่าคุณต้องการเรียกใช้กฎที่ซ้ำกันก็ต่อเมื่อค่าของฟิลด์ "แทนที่ซ้ำ" เป็น "ไม่" เงื่อนไขเป็นทางเลือกให้ระบุเงื่อนไขที่ระเบียนต้องตรงตามเพื่อให้กฎทำงาน

  4. ในตัวสร้างกระบวนการ / โฟลว์เมื่อคุณพยายามสร้างเรกคอร์ดใหม่หรืออัปเดตเรกคอร์ดที่มีอยู่ให้ตั้งค่าฟิลด์เพิ่มเติมนี้ 'แทนที่ซ้ำ' เป็น 'ใช่' นั่นหมายความว่าคุณกำลังพยายามส่งผ่านความชัดเจนของกฎที่ซ้ำกันในโฟลว์ดังนั้น กระแสนั้นจะไม่ส่งข้อความแสดงข้อผิดพลาดใด ๆ

  5. ใช้กฎเวิร์กโฟลว์และการอัปเดตฟิลด์เพื่อยกเลิกการตั้งค่า 'Override Flag' เป็น 'No' ทันทีหลังจากตัวสร้างกระบวนการอัปเดตเป็น 'ใช่' ชื่อกฎเวิร์กโฟลว์: WF Unset Override เงื่อนไขการตั้งค่าสถานะที่ซ้ำกัน: Override Duplicate = Yes Action: เรียก Workflow Field Update Workflow ชื่อการอัปเดตฟิลด์: WFU Unset แทนที่ฟิลด์ค่าสถานะที่ซ้ำกันที่จะอัปเดต: แทนที่ค่าแฟล็กที่ซ้ำกัน: ไม่ใช่

ที่สำคัญดูเหมือนว่าจะมี WF ทำการปรับปรุงครั้งสุดท้ายที่จะตั้งค่าสถานะกลับเป็นเท็จ สิ่งนี้ไม่พบข้อผิดพลาด (ซึ่งเฉพาะสำหรับ PB)