function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
santhosh Gundu 11santhosh Gundu 11 

How to update date field to published date + 90 days, whenever article is published

Sami ShakithSami Shakith
Hi Santhosh

I guess you publish your article using apex class (maybe with scheduled class) so you can update the field from the class itself.

I assume your published date field API name is published_date__c  and object variable name as article.
article.published_date__c = article.published_date__c.addDays(90);

you can put it in a list and update if you publishing list of articles. 

Does it make sense?
santhosh Gundu 11santhosh Gundu 11
Hi Sami,
more clarity given on question  When knowledge article published the publish status equal to published. In that time published time need to reflect in custom field. Using workflow or formula is there any way?
Sami ShakithSami Shakith
Yes you can try with both.

Below is the example with workflow

User-added image

If you wanna try formula field 

you also need to save your published date and try this
if(TEXT(Published_Status__c)=='Published', if(Published_Date__c<>null,Published_Date__c +90,null),null)

Let me know it helps you.