0

If I use standard button on Knowledge Article Version (KAV) called Assign (api name: AssignKnowledgeArticleVersion), it successfully updates the Assigned To (AssignedToId) field, however, I can't seem to find a way to update that same field without using that button.

I tried using Apex to directly update AssignedToId on KAV record, however, that field is not writeable:

Field is not writeable: Knowledge__kav.AssignedToId

At this point, I would probably give up, but the standard Assign button is able to change this field, and Salesforce seems to have exposed a method KbManagement.PublishingService.assignDraftTranslationTask(..) that can replicate the Assign button's behavior.

However, when I tried using the above method the AssignedToId still remains the same, even though I'm not getting any errors.

Now, the weirdest part is, when I retrieve the KAV record in workbench using REST API /services/data/v45.0/knowledgeManagement/articleVersions/translations/RECORD_ID, there's an assigneeId field in the response that holds the correct value, so something does get updated when I call KbManagement.PublishingService.assignDraftTranslationTask(..) method. The problem is that that's not reflected in the AssignedToId field, but probably somewhere else in the system.

enter image description here

Ultimately, what I need to do is to update the AssignedToId field on Draft articles via code, so that I can report on that field and use it in List View filters. Is there any way to do that?

2
  • Have you tried to set 'assigneeId' instead of AssignedToId?
    – Patlatus
    Commented Apr 18, 2019 at 11:42
  • I tried it now and got back an error Variable does not exist: AssigneeId. Also, if I try to query that field I get back No such column 'assigneeId' on entity 'Knowledge__kav'.
    – smukov
    Commented Apr 18, 2019 at 12:34

1 Answer 1

0

Here's what worked well for me:

KbManagement.PublishingService.assignDraftTranslationTask(
        articleId, assigneeId, instructions, null, false
    );

Draft localized article is assigned as expected. On force.com platform 48.0.

You must log in to answer this question.

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