servicenow - Service Now update() -


i want update problem state closed when incident state closed

i tried code updating records in problem table, want update related table.

// update state of active incidents 4 - "awaiting user info" var gr = new gliderecord('incident') gr.addquery('active', true); gr.query(); gr.state = 4; gr.updatemultiple(); 

it sounds use little glide scripting help. try more this:

// update state of active incidents 4 - "awaiting user info" var gr = new gliderecord('incident'); //create glide record gr.addquery('sys_id', current.incident_ref_field); //only relevant record should returned. gr.query(); if (gr.next()) {     gr.state = 4;     gr.update(); } 

you want 1 related inc record, make sure returned record matches record in ref field (which i've called incident_ref_field, should change actual field name).


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -