
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2024 11:10 PM
I have a variable called u_return_date, what I want to do is when someone submits their catalog item, the follow up field on the RITM is populated by getting the u_return_date value and adding 5 days to it.
eg: u_return_date is 01/07/2024 then make follow_up - 06/07/2024
What I have currently is a business rule on the sc_req_item table and is a before insert with the following script:
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var ReturnDate = g_form.getValue('current.u_return_date');
ReturnDate.addDays(5);
current.follow_up = ReturnDate;
})(current, previous);
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2024 12:08 AM - edited 06-26-2024 12:23 AM
Hi @Bidduam ,
You have used g_form which is client side API. Business rule is server side so it won't work.
Use the below it will work, I have tested in PDI.
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var ReturnDate = new GlideDateTime(current.variables.u_return_date);
ReturnDate.addDays(5);
current.follow_up = ReturnDate;
})(current, previous);
Output:
Mark this as Helpful / Accept the Solution if this helps
Mark this as Helpful / Accept the Solution if this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2024 12:51 AM
I have tested it again:
RITM OOB field:
Business Rule:
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var ReturnDate = new GlideDateTime(current.variables.u_return_date);
ReturnDate.addDays(5);
current.follow_up = ReturnDate;
})(current, previous);
Mark this as Helpful / Accept the Solution if this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2024 11:21 PM
Hi @Bidduam ,
As 'u_return_date' is a variable in the catalog item, you have to access it by the below:
current.variables.u_return_date;
Mark this as Helpful / Accept the Solution if this helps
Mark this as Helpful / Accept the Solution if this helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2024 11:25 PM
No that doesn't make any difference unfortunately
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2024 12:08 AM - edited 06-26-2024 12:23 AM
Hi @Bidduam ,
You have used g_form which is client side API. Business rule is server side so it won't work.
Use the below it will work, I have tested in PDI.
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var ReturnDate = new GlideDateTime(current.variables.u_return_date);
ReturnDate.addDays(5);
current.follow_up = ReturnDate;
})(current, previous);
Output:
Mark this as Helpful / Accept the Solution if this helps
Mark this as Helpful / Accept the Solution if this helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2024 12:43 AM
Is the "start Date" you have a OOTB field? mine is a variable
Follow Up is an OOTB field
So in my scenario I am grabbing the value from a catalog item variable, trying to add 5 days to that date and putting the new value in an OOTB field on the RITM.
Is that the same as what you have done? Because it is definitely not working for me