Quantcast
Channel: ServiceNow Community - Development & Integration
Viewing all articles
Browse latest Browse all 423

"Duplicate entry '' for key 'PRIMARY'" in workflow from script task

$
0
0

I am trying to create a request item that has, among other variables, a "related incident" reference. When this request item is submitted, if there's a related incident, I am opening that incident up and updating a "related record" field on it via a script task in the workflow. The flow is as such:

Start -> If (Has related incident is checked) -> Update incident -> (end if) -> Approval, tasks, etc.

This is my script task in the workflow:

if (current.variables.has_incident == "true") {
var gr = new GlideRecord('incident');
if (gr.get(current.variables.incident)) {

read more


Viewing all articles
Browse latest Browse all 423

Trending Articles