
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2016 07:30 AM
I have a need by our customer to update the Valid To date in KB articles by 1 year every time that KB article is updated.
So it should be looking at the updated (sys_updated_on) field and making the Valid To date (valid_to) 1 year from that date.
Should this best be handled thru a business rule.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2016 09:44 AM
Karen,
If you are on eureka, copy this script
setValidTo();
function setValidTo(){
var gr= new GlideDateTime(current.sys_updated_on.getDisplayValue());
gr.addYears(1);
current.valid_to=gr.getDate();
}
Thanks,
Abhinay
PS: Hit like, Helpful or Correct depending on the impact of the response

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2016 11:51 AM
Is there a link for the best practices docs. I always ask about Best Practices for things that I haven't done before that would be most helpful.
Thanks again.
Karen

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2016 11:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2016 11:56 AM
Hi,
Never use "current" in business rule.
we can use object.something

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2016 11:58 AM
Not true Midhun! There are lots of times you use current in a business rule.
BEFORE business rules are a classic example to set values. BEFORE, AFTER, and ASYNC rules can read values from current without any impact.
BTW, this is in an inbound email action, not a BR.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2016 11:58 AM