Recently while implementing Knowledge for one of my customers, I spend quite a good amount of time doing operations on Knowledge Articles through Flow. This post will focus on two highly used Knowledge Article operations i.e. Publish and Edit.
Before I go into further details, I will highly recommend you go through the below post to understand the Knowledge Data Model. Understanding Knowledge Data Model is the key as it will help you to use these actions in flow effectively and correctly. Here is the post –
With the assumption that you know Data Model quite well, let’s dive in –
Edit Knowledge Article
From Salesforce Flow, you can now edit the Knowledge article as a draft. To do that, you need to use the action and then “Create draft from online knowledge article” Knowledge article action as shown below
Here are the parameters –
Action – The possible values are
“EDIT_AS_DRAFT_ARTICLE” and
“EDIT_AS_DRAFT_TRANSLATION”.
Unpublish – “True” will archive the current published version and create a draft version. “False” will keep the current version published and create a new draft version.
Article ID: Article Id of the master published article. A draft article will be created from this one.
Publish Knowledge Article
Similar to the above from Salesforce Flow, you can now publish the Knowledge article. To do that, you need to use the action and then “Publish Knowledge Articles” Knowledge article action as shown below
Here are the parameters –
Article Version ID List – This is the list of article version ids. In your flow, you need to query and store the version ids in a collection and then use that collection here.
Publish Action – Possible values are
PUBLISH_ARTICLE – This will replace the existing online article.
PUBLISH_ARTICLE_NEW_VERSION – This will create a new online version.
SCHEDULE_ARTICLE_FOR_PUBLICATION
PUBLISH_TRANSLATION
Schedule Publish Date – You can schedule the publication by entering future dates.
Other Knowledge Actions
There are few other knowledge actions available to be used from the flow as well like –
Archive online knowledge articles
Delete Knowledge Articles
Restore archived knowledge article version
Submit Knowledge Article for Translation
Conclusion
As power comes with responsibilities, as a developer/admin, you need to keep in mind that not all Knowledge actions are bulkified. For example, editing knowledge articles as a draft is not bulkified. So if you try to edit many knowledge articles you will be presented with an error message. You need to find the threshold (Max # of articles you can edit as a draft using this action) and then within your flow, you need to make sure you are running a loop only for that threshold number only.
You can read my earlier blog post which will show you how you can break the loop and make sure your loop within flow runs only for n number of times(not for the entire list).
While working in Salesforce, we need to deal with data almost every day. Loading or extracting data is an important pre-requisite for almost all production deployment/Go-Live activity. Do you know the there are many different data loaders available today? This post will cover some of the most popular data loaders with their advantages and disadvantages.
Data Import Wizard
This is built by Salesforce and available in all editions. It has a very easy step by step user interface which makes it very popular among the Salesforce developer/admins. You can load many standard objects including Accounts & Contacts, Leads, Campaign Members, Person accounts. You can load custom objects too with this one.
Advantages:
User friendly.
Disadvantages:
Can load a maximum of 50,000 records at a time. In a real-world scenario, this can be a problem as the number of records can be in the range of millions.
Winter 21 release is bringing many great features for us. We are all excited. Here are some of my posts covering some of the important features that will come with the Winter 21 release –
In today’s post, I will be discussing about the feature which will allow us to send custom notifications using Apex.
Introduction of Custom Notification
Custom notifications are the customized notifications that can be sent when some action happened with Salesforce. For example, every time a new knowledge article is published, we can publish a custom notification to all the users/selected users. These notifications are real-time i.e. users don’t require to refresh their existing page to get the notification. On the same only, these notifications will be presented on the bell icon.
Create Custom Notification
Type ‘Notification’ in the setup search
Click ‘Custom Notifications’ under ‘Notification Builder’
Click New
Enter the name for example – “Knowledge Notification”
Select the channels (Mobile and/or Desktop).
Apex Code to Send Notification
//New Class introduced to deal with Custom Notifications
Messaging.CustomNotificationsingleNotification =
newMessaging.CustomNotification();
//Required – Setting up the Body
singleNotification.setBody(‘New Article is published’);
//Required – Setting up the title
singleNotification.setTitle(‘Check the new article!’);
With this new object Messaging.CustomNotification, we don’t require to do complex work to send notification from Apex anymore. I hope this will help you.