- 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-06-2019 08:10 AM
https://us04web.zoom.us/j/248925463
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-06-2019 08:10 AM
try this

- 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();
}
}