
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2018 08:04 AM
Good Morning All,
I am running a business rule on my incident table which requires me to update a time field on a different table. I have tried several iterations of the code but nothing seems to work.
The line of code I am using is
data.setValue('u_timefield', gs.now());
I have also tried SetDisplayValue as well as trying
data.u_timefield = gs.nowDateTime();
but still nothing. Any idea how I can accomplish this?
Solved! Go to Solution.
- Labels:
-
Best Practices
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2018 08:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2018 08:38 AM
Thats fine
gr.fieldName=new GlideDateTime();
considering gr is the glide object to that record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2018 08:52 AM
It runs but nothing happens...here's my full code...
var rr = new GlideRecord("u_round_robin"); //Queue up the Round Robin Table
rr.addQuery('u_active', true); //Find users that are active.
rr.orderBy('u_last_assigned'); // Order it by ths last assigned field
rr.orderByAsc('u_last_assigned'); //Sort it by oldest first.
rr.query(); //Start the search
if (rr.next()) //If the criteria is met run this.
{
gs.print(rr.getDisplayValue('u_technician.name')); //Works
gs.print(rr.getDisplayValue('u_last_assigned')); // Works
rr.u_last_assigned = new GlideDateTime(); // Will not update the users record.
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2018 08:57 AM
var date = new GlideDateTime();
rr.u_last_assigned.setDisplayValue(date);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2018 08:38 AM
Please explain your requirement.
what data in your query.
In every table there are default created and updated date columns.
Thanks