- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2023 11:39 PM
Hi All,
I have requirement that
In knowledge article form we have one field called "Review Date" field.
When user submits the knowledge article the if that field is empty then I need to add one year in that date field.
Could you please help me on this.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2023 12:39 AM
@msc you can use if the field is available on the form, but I prefer doing it in BR.
In the above BR, add one more Condition like,
Review Date :: Is Empty
Please mark my answer helpful and accept as solution if it helped you 👍✅
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2023 12:09 AM
Hi @msc
If the review date field is date time field you can create a Before Insert/Update Business Rule like the one below.
(function executeRule(current, previous){
var gdt = new GlideDateTime();
gdt.addYearsUTC(365);
current.u_review_date = gdt; //Change field name as per your configuration
})(current, previous);
If your field type is Date use the following script.
(function executeRule(current, previous){
var gdt = new GlideDateTime();
gdt.addYearsUTC(365);
current.u_review_date = gdt.getDate(); //Change field name as per your configuration
})(current, previous);
Please mark my answer helpful and accept as solution if it helped you 👍✅
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2023 12:30 AM
Hi Anvesh,
Thanks for your response. Is it possible to use onsubmit client script here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2023 12:39 AM
@msc you can use if the field is available on the form, but I prefer doing it in BR.
In the above BR, add one more Condition like,
Review Date :: Is Empty
Please mark my answer helpful and accept as solution if it helped you 👍✅
Anvesh