Unique Key violation detected by database (Duplicate entry '8034aa69dbf0530007b07d598c961982' for key 'PRIMARY') 8034aa69dbf0530007b07d598c961982? Why I am getting this error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2018 04:47 AM
Hi Experts
Please help me on this!!
I am getting this error.
Unique Key violation detected by database (Duplicate entry '8034aa69dbf0530007b07d598c961982' for key 'PRIMARY')
I have written an after Business Rule on update of sys_user table. I am not sure why am I getting this error.
As per my requirement whenever there is a termination date found in the User table. It should create an RITM when there is an update in the User table.
The script is provided below which works fine and the Request and the RITM creates successfully.
The only issue is with the error which I am getting.
Here is the screen shot of the Business Rule and the script provided below.
var requested_for = current.name;
var cartId = GlideGuid.generate(null);
var cart = new Cart(cartId);
var item = cart.addItem('8ff73f67db9bcb40952dff971d961989');
cart.setVariable(item,'o_adobe_cc',true);
cart.setVariable(item,'o_adobe_dc',true);
cart.setVariable(item,'o_ajera',true);
cart.setVariable(item,'o_arena',true);
cart.setVariable(item,'o_autodesk',true);
cart.setVariable(item,'o_bluebeam',true);
cart.setVariable(item,'o_credit_card',true);
cart.setVariable(item,'o_email',true);
cart.setVariable(item,'o_primavera',true);
cart.setVariable(item,'o_sap',true);
cart.setVariable(item,'o_webcatalog',true);
cart.setVariable(item,'o_zoom',true);
cart.setVariable(item,'o_employee',requested_for);
//current.short_description = "Offboarding request for " + current.variables.o_employee.name;
gs.addInfoMessage(rc.number);
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2018 05:57 AM
Search user table Filter sysid is 8034aa69dbf0530007b07d598c961982
Most likely there is another account with same user id or email
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2020 07:53 AM
I had the same error:
"Error Message Unique Key violation detected by database ((conn=271290) Duplicate entry '91a830a54983945085cdb14a691122fc' for key 'PRIMARY')"
In my case I used a business rule to assign the value to the field which didn't exist.
newTask.ms_doc = current.sys_id;