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
pratyushpratyush 

Setting Channels on Knowledge Articles from Apex

I'm actually creating a knowledge article from my apex class and I need to provide access to our external users (i.e. community / portal users) so that they could access these newly created knowledge articles. I tried setting the channels by marking IsVisibleInPrm, IsVisibleInPkb, IsVisibleInCsp, IsVisibleInApp fields as true for the knowledge article and the related sObjects. But it seems that these fields are not writeable.

Can we set the Channels (i.e. all isVisible fields) for any of the published knowledge articles from apex so that it is accessible to the portal/community users?
ShashankShashank (Salesforce Developers) 
You can probably try to change the status to draft from published for the knowledgearticleversion record and check if you are able to write into those fields.
Nishant SharmaNishant Sharma
Hi @pratyush: Did you find solution for this? I am encountering almost similar issue. I have scenario, when I am creating Article from Case, I want to set visibility for all channel as true. I am able to place necessary code in apex and it reflects in debug, but doesn't reflect on UI. Any thought?