- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2015 11:59 AM
I have an approval workflow that executes correctly until I add a Create Task item at the end. It creates a ticket in the Incident table but generates the following error:
Unique Key violation detected by database (Duplicate entry 'b9eec7c40fce4a40b2908b2022050eb5' for key 'PRIMARY')
When I remove the Create Task from the workflow it doesn't throw the unique key violation. The Create Task item in the workflow is using a template to create the Incident.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2015 05:53 AM
I opened an Incident with HI and got a good answer. A business rule was causing the aforementioned error. The Check for Children Resolved BR was the culprit. Disabling that BR stopped the unique key error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2015 12:47 PM
Hi Tim,
Is it always that same sys_id?
If so, it sounds like the sys_id got added to the template that is being used to generate the task. Remove the sys_id field from the template (not the template's sys_id, but the part of the template which tells the workflow to make the inserted record's sys_id "b9eec7c40fce4a40b2908b2022050eb5").
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2015 12:51 PM
It's a different sys_ID each time. I also get the same error when I delete the tasks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2015 12:56 PM
Do you have any business rules on incident or task which do "current.insert()" or "current.update()"?
Do you call current.insert() in multiple places (e.g. more than one time total across every UI Action script through the Workflow that gets kicked off between when you start the transaction and when you ultimately see the error)?
It sounds like something is calling insert() on a GlideRecord that already exists.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2015 12:49 PM
Have you tried creating the incident manually with same values as template?.