1

I have a requirement to send custom notification to a group every time knowledge articles are published.

Now my problem is that when I am writing Apex trigger (After Insert, After Update, Before Insert, Before Update), trigger is not firing when the article is published(Publication Status changes from 'Draft' to 'Online").

Looking for some ideas how can I solution this? Thanks.

1
  • Even I am facing the same issue, in my case, I am capturing the current data whenever the article is published from API and the condition I have put is. If(oldMap(Id).PublishedStatus == 'Draft' && newMap(Id).PublishedStatus='Online') { PublishedDate=date.today(); } but when I publish the article in logs I can see both old and new PublishedStatus is 'Draft' only. So it's not going inside if condition only. Can someone help me? thanks..
    – Manjunath
    Commented Dec 21, 2021 at 8:29

2 Answers 2

2

Looks like this limitation is clearly documented.

One workaround would be to maintain a custom field (may be a picklist or a Boolean ) and trigger off based on that and publish an article based on the custom field value.

If you are on classic lightning this would mean a field on Evey article type and hence lightning migration might be something to plan.

This adds some custom work and maintenance but if business needs this functionality worth a try.

1

Just to add another option - you can use Approval processes on Knowledge.

This would require that everyone "submit for approval" instead of "publish" (you can hide the button).

It asks for certain criteria to require the approval, else Approve. In your case, you'd essentially just be auto-approving everything.

From here, you can set up actions to take place on the approval action ("Final Approval Actions"). You would create a knowledge action to actually publish the article and you can set up email alerts that would email the relevant groups.

This also helps in case in the future you get different requirements to email different groups depending on the article. You can have different processes for different articles.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .