- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2016 12:07 PM
in my incident form I have a date type field called : Projected Fix Implementation Date
I have a field which is called :Implementation Date Changed Count and actually this field acts as a counter which means:
when the Projected Fix Implementation Date is changed , the counter will be incremented.
What I'm thinking to do is to create a script include and use glide ajax on my client script ; but I need some help:
This is my on change client script so far and i still haven't worked on the script include:
I'd appreciate it if you can correct me:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '') {
return;
}
var projected_date = g_form.getValue('u_fix_implementation_date');
var ajax = new GlideAjax('AjaxCounterField');
ajax.addParam('sysparm_name','ContCalc');
ajax.addParam('sysparm_pr_date',pr_date);
ajax.getXMLWait();
var answer = ajax.getAnswer();
g_form.setValue('u_implementation_date_changed_', answer);
}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2016 12:16 PM
I am not sure why you want to complicate things by writing a script include and doing an ajax call...
Craete a business rule similar to OOB "reassignment counter" BR on incident table.
Can you not write a before update business rule and do something like this :-
var counter = current.u_implementation_date_changed_; //If this an integer field
if(current.u_fix_implementation_date.changes())
counter++;
current.u_implementation_date_changed_ = counter;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2016 12:16 PM
I am not sure why you want to complicate things by writing a script include and doing an ajax call...
Craete a business rule similar to OOB "reassignment counter" BR on incident table.
Can you not write a before update business rule and do something like this :-
var counter = current.u_implementation_date_changed_; //If this an integer field
if(current.u_fix_implementation_date.changes())
counter++;
current.u_implementation_date_changed_ = counter;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2016 12:22 PM
So I can just create a business rule for that? Thanks for your help!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2016 12:23 PM
Yes. Only a BR. Check that OOB "reassignment counter" on incident table...
No problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2016 09:31 AM
Hi mansi, I have a question regarding catalog task notifications. What's
your email address??
On Mar 31, 2016 3:23 PM, "manapt25" <community-no-reply@servicenow.com>