FYI- Related knowledge Article on Record Producer (HR PORTAL) does not work properly if the article is marked

Pankaj Kumar1
Tera Expert

STEPS TO ATTACH KB ARTICLES TO RECORD PRODUCER

  1. Navigate to the record producer associated to the catalog item.   The easiest way is through the HR Administration > HR Services > Manage HR Catalog path in the nav bar and then clicking the "Edit catalog item" button that appears when hovering over a catalog item.
    find_real_file.png
  2. Add a new variable to the record producer.
    find_real_file.png
  3. Create the new variable as Type = Macro.  The order number will determine where the KB Articles will appear on the page in relation to the other variables.   The Widget selected under the Default Value tab will be "HRI Catalog to KB Article Display".
    find_real_file.png
  4. Navigate back to the Manage HR Catalog module and click the "Manage KB articles" icon that appears when hovering over a catalog item.
    find_real_file.png
  5. Create new records on this table to assign the necessary Knowledge Articles to their respective Catalog Items.
  6. Test your changes by navigating to your catalog item on the portal.   The new widget with the catalog items should appear as shown in the screenshot below.
    find_real_file.png

--------------------------------------------------------------------------------------------------------------------------------------

ISSUE :- Related knowledge article on HR Service Form/record Producer(HR PORTAL) does not work properly for end-users if the knowledge article is updated/retired. 

It works fine for admins but for end users(no knowledge roles) it does not. Screenshots below.

1. If updated and Published with a new version - System does not show the article short description but just the icon. Screenshot attached below. 

2. If Retired - System still shows the article even if it is retired.

Updated Article Screenshot (Version V2)

find_real_file.png

Portal View (Admin vs End User)

  Article name is missing for end-user.

find_real_file.png

 

--------------------------------------------------------------------------------------------------------------------------------------

SOLUTION:-

Linking Between KB Articles and Record Producer/Catalog Items is handled in table  "Catalog Item to KB Links [sc_2_kb]".

Create an after(insert/Update) Business rule on Knowledge [kb_knowledge] table with appropriate filters. E.g. workflow is Published/retired and update the record in sc_2_kb table with the updated version of of the KB article or delete the record if the article is retired.

It works fine for End user in both the cases Published and Retired.

find_real_file.png

Here is the simple code:-

 

(function executeRule(current, previous /*null when async*/) {

                var gr= new GlideRecord('sc_2_kb');

                gr.addQuery('kb_knowledge.number',current.number);

                gr.query();

                if(gr.next()){

                                if(current.workflow_state=='published'){

                                                gr.setValue('kb_knowledge',current.sys_id);

                                                gr.update();

                                }

                                if(current.workflow_state=='retired'){

                                                gr.deleteRecord();

                                }

                }

})(current, previous);

 

2 REPLIES 2

John Prouty
Kilo Guru

I tried to do this in Orlando for a custom (non HR) table.  I couldn't get it to work.  I can't find the table Catalog Item to KB Links [sc_2_kb].

Hey John, the widget used in my scenario was specific to HR..