How to update valid date of knowledge article when user click the republish button
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2023 05:00 AM
Hi Team,
How to update the valid date automatically of knowledge article when the user clicks the republish button.
Example: Valid date of the knowledge article is 2023-08-02
The user click's the republish button on 2023-08-17, and the valid date automatically changes to 2023-11-17 (3 months from the date of re-publishing the knowledge article).
Regards,
Manasa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2023 02:22 AM
Hi @Manasa Allu
You may need to update the OOB UI action to meet the criteria.
But please keep in mind it will not be upgrade-safe.
Script to be updated for reference:
var gdate = current.valid_to.getGlideObject(); //considering valid_to is date field on current form
current.valid_to=gdt.addMonths(3); //adding 3 months to date selected
current.update();
Please mark it Correct and Hit Like if you find this helpful!
Regards,
Karthiga