- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2015 09:17 AM
Hi Friends,
I am new to SNOW Development.I have one requirement regarding problem form.Below is the requirement:
I have one problem record.In that there is one field called updated(date and time field).In that problem record there is one related list called Problem task(related to problem_task table). If i create or update the problem task record,then the updated field in the parent record will get updated with current date and time.For this requirement i have created one business rule on table PROBLEM and when as AFTER UPDATE.I had written this code:
var parent_problem = current.problem;
var parent_sys_updated_on= parent_problem.sys_updated_on;
if(current.problem_task==created ||current.problem_task==updated)
{
current.problem_sys_updated_on=gs.nowDateTime();
}
I need assistance on this.Kindly please help friends.Waiting for your response...........
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2015 09:45 AM
Kumar,
What you need to do is to have a business rule on the Problem Task which will run everytime and have the script as something like:
var gr = new GlideRecord('problem');
gr.get(current.problem.sys_id);
gr.setForceUpdate(true);
gr.update();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2015 09:45 AM
Kumar,
What you need to do is to have a business rule on the Problem Task which will run everytime and have the script as something like:
var gr = new GlideRecord('problem');
gr.get(current.problem.sys_id);
gr.setForceUpdate(true);
gr.update();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2015 10:19 AM
Hi Manikanta.Thanks for your response.
So what i understand from your above code is no need of using glide date functions?
I have used above code.But its not working.Can you please suggest on this!!!!!!!
Thanks in Advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2015 10:30 AM
Kumar,
Can you send me the screenshot of your business rule?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2015 10:38 AM
Hi Mani kanta,
I have just modified the code by placing glide date function.It worked. Thank you very much for your time.See the modified code once:
var gr = new GlideRecord('problem');
gr.get(current.problem.sys_id);
gr.setForceUpdate(true);
current.problem_sys_updated_on=gs.nowDateTime();
gr.update();