function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Arun Sarvan SamArun Sarvan Sam 

Duplicate value found issue

Selected Navigation Button: NEXT
DECISION: Relatedbookingsearch
Outcome executed: Field_is_Blank
Outcome conditions: 
1. {!SearchRelatedBookAccount} () Equals
2. {!OngoingGroup} (true) Equals true
3. {!Registration_Type} (Annual) Does not equal {!Full} (Full)
4. {!OngoingGroup} (true) Does not equal true
5. {!AgentName1} (Lorraine Dougall) Does not equal {!PleaseSelect} (Please Select)
Logic: Advanced Logic ((1 AND ((2 AND 3) OR 4)) AND 5)
GET RECORDS: Discount_Lookup_0_0
Find one Discountc record where:
Expiredc Equals false
Non_Transferc Equals true
Name Equals {!Discount_code2} ()
Result
Failed to find record.
DECISION: ValidYesNo3
Outcome executed: DiscountValid3
Outcome conditions: 
{!DiscountValid} (true) Equals true
CREATE RECORDS: Create_Student_0
Create one Account record where:
BillingCity = {!Billing_City} ()
BillingPostalCode = {!Billing_Postcode} ()
BillingState = {!Billing_County} ()
BillingStreet = {!Billing_Street} ()
Date_of_Birthc = {!Date_of_Birth} (null)
Date_of_Last_Bookingc = {!$Flow.CurrentDate} (09 July 2019)
FirstName = {!First_Name} (Iris)
LastName = {!Last_Name} (Fritschi)
PersonEmail = {!Email} (iris_fritschi@hotmail.com)
Phone = {!Phone} ()
RecordTypeId = 012w0000000Jvw6
Salutation = {!SALUTATIONCHOICE} (Ms.)
Result
Failed to create record.
Error Occurred: This error occurred when the flow tried to create records: DUPLICATE_VALUE: duplicate value found: Student_Email_Uniquec duplicates value on record with id: 0011r00001vuSPZ. You can look up ExceptionCode values in the SOAP API Developer Guide.
Arun Sarvan SamArun Sarvan Sam
Hi Friendz,

Please help me to sort out this issue in production?
Manoj ThangavelManoj Thangavel
Hi Arun,

It looks like either duplicate detection enabled in the org or The Email address on Account or Contact object enabled as a unique field, so you are getting this Error from the flow.

1. Modify the flow to check condition if any existing record with the Email address
2. or  disable the deduplication rule
3. if Email field enabled as unique one, then remove that

Thanks,
Manoj T
Arun Sarvan SamArun Sarvan Sam
Hi manoj,

Please find the below formula applied for the Email__c field
1. 
IF (  NOT($User.Id = "005w0000003xocq"), PersonContact.Email, null)

2. 
Error Occurred: This error occurred when the flow tried to create records: DUPLICATE_VALUE: duplicate value found: Student_Email_Uniquec duplicates value on record with id: 0011r00001vuSPZ

Error Occurred: This error occurred when the flow tried to create records: DUPLICATE_VALUE: duplicate value found: Student_Email_Uniquec duplicates value on record with id: 0011r00001vuSPZ

Please help me?? How to resolve this case? 

Now, monthly booking is working but we can't able to book for this user biannual/annual booking for this course
 
Manoj ThangavelManoj Thangavel
Hi Arun,

We need to amend the flow, to not to create a new record if the email exists in the object.
Ref:
https://trailhead.salesforce.com/en/content/learn/projects/flow_reassign/flow_reassign_find
https://developer.salesforce.com/forums/?id=9062I000000g7CmQAI

Thanks,
Manoj T
Arun Sarvan SamArun Sarvan Sam
Hi Manoj,

I tried to deactivate the flow, unique validation rule but still, a student is not getting registered for the particular annual/biannual booking. Normal monthly booking is working.

Tried with the above forum link also not working. Pls help
 
Manoj ThangavelManoj Thangavel
Hi Arun, Please check "Allow" on create & Edit as below, [image: Screen Shot 2019-07-16 at 9.45.17 PM.png] Thanks, Manoj T +91 9566582294
Arun Sarvan SamArun Sarvan Sam
I have enabled the error log and pasted the part of log details,

This seems to exceed the time limit at a certain location please check and let me know?


19:31:20.984 (22984272274)|CUMULATIVE_LIMIT_USAGE_END

19:31:20.415 (22985481696)|CODE_UNIT_FINISHED|RichText2 on CampaignMember trigger event BeforeUpdate|__sfdc_trigger/RichText2
19:31:20.415 (23018384339)|WF_TIME_TRIGGERS_BEGIN
19:31:20.415 (23018490779)|WF_ACTIONS_END| Field Update: 14; Flow Trigger: 24;
19:31:20.415 (23018512669)|CODE_UNIT_FINISHED|Workflow:CampaignMember
19:31:21.37 (23037645484)|FLOW_ELEMENT_ERROR|This error occurred when the flow tried to create records: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: RichText2: System.LimitException: Apex CPU time limit exceeded. You can look up ExceptionCode values in the <a href='https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_calls_concepts_core_data_objects.htm#'>SOAP API Developer Guide</a>.|FlowRecordCreate|myRule_1_A1
19:31:21.37 (23072341721)|FLOW_START_INTERVIEWS_END|1
19:31:21.72 (23072695453)|WF_FLOW_ACTION_ERROR|09L1r000000boUj|300w0000000L9Q4|Error executing flow: Create_Biannual_Booking_Records_2, FlowDefId: 300w0000000L9Q4, FlowVersionId: 301w0000000Czma
19:31:21.72 (23072788855)|WF_FLOW_ACTION_ERROR_DETAIL|This error occurred when the flow tried to create records: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: RichText2: System.LimitException: Apex CPU time limit exceeded. You can look up ExceptionCode values in the SOAP API Developer Guide.
19:31:21.72 (23072915584)|WF_FLOW_ACTION_END|09L1r000000boUj
19:31:21.72 (23072942169)|CODE_UNIT_FINISHED|Workflow:CampaignMember
19:31:21.87 (23087199034)|FLOW_ELEMENT_ERROR|This error occurred when the flow tried to create records: CANNOT_EXECUTE_FLOW_TRIGGER: We can't save this record because the “Create Biannual Booking Records (2)” process failed. Give your Salesforce admin these details. This error occurred when the flow tried to create records: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: RichText2: System.LimitException: Apex CPU time limit exceeded. You can look up ExceptionCode values in the SOAP API Developer Guide. Error ID: 125512612-159369 (-822624496). You can look up ExceptionCode values in the <a href='https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_calls_concepts_core_data_objects.htm#'>SOAP API Developer Guide</a>.|FlowRecordCreate|myRule_1_A1
19:31:21.87 (23114618730)|FLOW_START_INTERVIEWS_END|1
19:31:21.114 (23114864321)|WF_FLOW_ACTION_ERROR|09L1r000000boVc|300w0000000L964|Error executing flow: Create_Month_2_Booking, FlowDefId: 300w0000000L964, FlowVersionId: 301w0000000HMxO
19:31:21.114 (23114932896)|WF_FLOW_ACTION_ERROR_DETAIL|This error occurred when the flow tried to create records: CANNOT_EXECUTE_FLOW_TRIGGER: We can't save this record because the “Create Biannual Booking Records (2)” process failed. Give your Salesforce admin these details. This error occurred when the flow tried to create records: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: RichText2: System.LimitException: Apex CPU time limit exceeded. You can look up ExceptionCode values in the SOAP API Developer Guide. Error ID: 125512612-159369 (-822624496). You can look up ExceptionCode values in the SOAP API Developer Guide.
19:31:21.114 (23115016885)|WF_FLOW_ACTION_END|09L1r000000boVc
19:31:21.114 (23115035563)|CODE_UNIT_FINISHED|Workflow:CampaignMember
19:31:21.130 (23130901025)|FLOW_ELEMENT_ERROR|This error occurred when the flow tried to create records: CANNOT_EXECUTE_FLOW_TRIGGER: We can't save this record because the “Create Biannual Booking Records” process failed. Give your Salesforce admin these details. This error occurred when the flow tried to create records: CANNOT_EXECUTE_FLOW_TRIGGER: We can't save this record because the “Create Biannual Booking Records (2)” process failed. Give your Salesforce admin these details. This error occurred when the flow tried to create records: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: RichText2: System.LimitException: Apex CPU time limit exceeded. You can look up ExceptionCode values in the SOAP API Developer Guide. Error ID: 125512612-159369 (-822624496). You can look up ExceptionCode values in the SOAP API Developer Guide. Error ID: 125512612-159370 (-822624496). You can look up ExceptionCode values in the <a href='https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_calls_concepts_core_data_objects.htm#'>SOAP API Developer Guide</a>.|FlowRecordCreate|Add_to_campaign
19:31:21.130 (23167519407)|FLOW_ELEMENT_ERROR|This error occurred when the flow tried to create records: CANNOT_EXECUTE_FLOW_TRIGGER: We can't save this record because the “Create Biannual Booking Records” process failed. Give your Salesforce admin these details. This error occurred when the flow tried to create records: CANNOT_EXECUTE_FLOW_TRIGGER: We can't save this record because the “Create Biannual Booking Records (2)” process failed. Give your Salesforce admin these details. This error occurred when the flow tried to create records: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: RichText2: System.LimitException: Apex CPU time limit exceeded. You can look up ExceptionCode values in the SOAP API Developer Guide. Error ID: 125512612-159369 (-822624496). You can look up ExceptionCode values in the SOAP API Developer Guide. Error ID: 125512612-159370 (-822624496). You can look up ExceptionCode values in the <a href='https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_calls_concepts_core_data_objects.htm#'>SOAP API Developer Guide</a>.|FlowScreen|Select_Student
19:31:21.197 (23197418366)|VF_SERIALIZE_VIEWSTATE_BEGIN|066w0000001ZZbR
19:31:21.197 (23200169126)|VF_SERIALIZE_VIEWSTATE_END
19:31:21.203 (23203378612)|CUMULATIVE_LIMIT_USAGE
19:31:21.203 (23203378612)|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 5 out of 100
  Number of query rows: 3 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 1 out of 150
  Number of DML rows: 1 out of 10000
  Maximum CPU time: 0 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 100
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 50
  Number of queueable jobs added to the queue: 0 out of 50
  Number of Mobile Apex push calls: 0 out of 10

19:31:21.203 (23203378612)|CUMULATIVE_LIMIT_USAGE_END

19:31:21.197 (23203498936)|CODE_UNIT_FINISHED|VF: /apex/Flow
19:31:21.197 (23204824268)|EXECUTION_FINISHED

 
Arun Sarvan SamArun Sarvan Sam
Hi Manoj,

Please help on this and try with process builder, flows, etc.. not able to fix this. Please help me with the above error log.

Thanks,