- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-04-2019 12:49 PM
Can some one help me with this script
I have a table u_test_results in which there is a record XYZ1 ( with name as u_name)
I have a catalog item on which we have a variable which is reference field of above table , when a user picks the above record and place a request we need to set a current time on other table
in the workflow i am writing this script and its not setting the time . Can you please help me fixing this issue .
The other table is u_solution which has 2 fields
1 closed date and 2.record for (this field contains XYZ record and its a reference field too)
var GOT= parseInt(current.variables.u_name.getDisplayValue());
var gr = new GlideRecord('u_solution ');
gr.addQuery(u_recorded_for, GOT);
gr.query();
if (gr.next()) {
gr.u_closed_date = current.opened_at;
gr.update();
}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-06-2019 08:45 AM
Updated Script:
var tenant= new GlideRecord('u_delegated_management_environment');
if(tenant.get('faf6c496dbfd3380cebc550a48961983')) {
var test = tenant.name;
var gr = new GlideRecord('u_mou');
gr.addQuery('u_service.name',test);
gr.query();
while(gr.next()) {
gr.u_end_date=gs.nowDateTime();
gr.update();
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-04-2019 12:52 PM
try
var GOT= parseInt(current.variables.u_name.getDisplayValue());
var gr = new GlideRecord('u_solution');
gr.addQuery('u_recorded_for', GOT);
gr.query();
if (gr.next()) {
gr.u_closed_date = current.opened_at;
gr.u_recorded_for = current.sys_id;
gr.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-04-2019 01:20 PM
Thanks Mike ,, the end date didnt populated ( its not working )

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-04-2019 01:27 PM
Did it update below field ?
u_recorded_for
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-05-2019 06:33 AM
yes that is same as u_name