- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2016 03:04 PM
With a background script, I am trying to query all of the records of my dmn_demand table, and fill in a field with matching data from another field already present on each record.
This is the code that I have tried and didn't have work. Thought I'd reach out to the community for some pointers on where I am going wrong:
var gr = new GlideRecord('dmn_demand');
- gr.query();
while (gr.next()) {
- gr.autoSysFields(false);
- gr.u_task_for = gr.u_requestedfor;
- gr.update();
}
Thank you
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2016 03:09 PM
Hi Shane,
Can you please confirm if field column name is u_requestedfor. I am assuming it should be u_requested_for.
Also add gr.setWorkflow(false); line before gr.update(); and try once.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2016 02:35 PM
There might be a business rule which might be aborting the change. Please check for the same.
Let me know if you have any questions.