Skip to main content
Skip table of contents

Adding KB Access to Case Pages

A Knowledge Base can be integrated into a DCM Solution utilizing a Coded Page, an URL, or lunch it by clicking a button.

The next steps will show you how to do this.


Create Solution Variable in AppSutdio

  1. Navigate to App Studio → <<DCM Solution>>
  2. Go to Solution Preferences → Solution Variables
  3. Create a new variable named KB_SERVER_NAME
  4. Set the Default value with the URL of the KB you need to access. The URL format is <Server_URL_Base>/Ecx.Web/en-US/do/{0}?appid=root_KBReaderApp&d<domain>&{1}

    Do not forget to add the '{0}' and '{1}' in the URL as this will be used later in the JavaScript examples code.

  5. Check the option Is Public (true).

  6. Save the new variable.
  7. After creating the variable deploy the DCM Solution.
  8. After the deployment, validate the value of the variable in Setup → Advanced Setup → Maintenance (1).

Getting the Sample Codes

  1. Open the Knowledge Base
  2. Navigate to Setup → Portal Widget Launcher (1)
  3. In the right panel select the KBCODES of the KBs you want to access (2).
  4. Click the Launch button to open the KB in the left panel (3).
  5. Click the Get Integration Code button to obtain the sample codes for a Coded Page and a Button (4).
  6. In the Portal Widget Integration pop-up window copy the JavaScript code examples for DCM Coded Page to an editor.
  7. Close the pop-window
  8. In the right panel add in the SEARCHVALUE field the word 'search' and click the Launch button. This parameter filters the articles and will show only the ones that have the word 'search' on them.
  9. In the Portal Widget Integration pop-up window copy the JavaScript code examples for DCM Button to an editor.
  10. Close the pop-window.
  11. In the right panel, select _Without Category_ under CATEGORYCODES list, type the word 'how' in the SEARCHVALUE field, and uncheck the SHOWALL option. Click the Launch button.
  12. In the Portal Widget Integration pop-up window click the Link, you can copy it using context menu. This will open a new tab in the browser, copy the URL to an editor.
  13. Close the pop-window.
  14. Close the Portal Widget Launcher

Adding a KB Tab into a Case Page

  1. On the top right, navigate to 
     → <<your solution>>
  2. On the left, navigate to 
     → Setup
  3. Go to Forms and Pages → Detail Pages (1)
  4. Open a Case Detail page.
  5. In the Case Detail Page Builder drag-and-drop a Form Viewer from the Tabs toolbox (2) to the right panel at the right side of the People tab.
  6. In Add element – Tab pop-up window, select Custom URL from the Content Type drop-down list.
  7. In the Tab Title field type How To.
  8. In the URL field under URL Settings paste the URL obtained in the previous steps.
  9. Save the new tab.
  10. Save the Detail Page
  11. Do a Preview and validate that the How To tab is showing correctly.
  12. Close the

Adding a Button into a Case Page to Open a KB

  1. On the top right, navigate to 
     → <<your solution>>
  2. On the left, navigate to 
     → Setup
  3. Go to Forms and Pages → Detail Pages (1)
  4. Open a Case Detail page.
  5. In the Case Detail Page Builder drag-and-drop an Action Button from the Buttons toolbox (2) to the header.
  6. In Add element – Button pop-up window, select Execute custom JavaScript from the Action drop-down list.
  7. For the Button Icon select search.
  8. In the Button Text type How To Search
  9. For the Button Tooltip type How To Search Help
  10. In the JavaScript Code field, paste the code obtained in the previous step from "JavaScript code examples for DCM Button"

    Example for DCM Button

    JS
    // KB_SERVER_NAME System Variable value example:
    // <Server_URL_Base>/Ecx.Web/en-US/do/{0}?appid=root_KBReaderApp&d<domain>&{1}
    
    var frameId = 'iframeKBMainView_'+Ext.id()
    var cmp = new Ext.Component({
      autoEl: {
        tag: 'iframe',
        style: 'height: 100%; width: 100%; border: none',
        src: Ext.String.format(Config.SYSTEM_VARIABLES.KB_SERVER_NAME, 'root_KBPortalWidget', 'WIDGETID=KB_Widget&KBCODES=KB_USER_GUIDE&SEARCHVALUE=search&SHOWALL=1'), 
      },
      id: frameId,
      listeners: {
        render: function() {
          var panel = this.up('panel');
          panel.mask('Loading');
          Ext.get(frameId).on(
            'load', 
            function() { 
              panel.unmask(); 
            });
          }
       }
    });
    return { layout: 'fit', items: cmp}
  11. Change the color for the button.
  12. Save the button configuration.
  13. Do a Preview and validate the action of the button

  14. Close the

Adding a Coded Page to See a KB into a Case Page

  1. On the top right, navigate to 
     → <<your solution>>
  2. On the left, navigate to 
     → Setup
  3. Go to Forms and Pages → Coded Pages
  4. Create a new coded page by clicking the New Coded Page 
    button
  5. Name it User Guide Help
  6. Add User Guide Help Coded Page for Description.
  7. In the JavaScript Code area, paste the code obtained in the previous step from "JavaScript code examples for DCM Coded Page"

    Example for DCM Coded Page

    JS
    // KB_SERVER_NAME System Variable value example: 
    // <Server_URL_Base>/Ecx.Web/en-US/do/{0}?appid=root_KBReaderApp&d<domain>&{1}
    
    var frameId = 'iframeKBMainView_'+Ext.id()
    var cmp = new Ext.Component({
      autoEl: {
        tag: 'iframe',
        style: 'height: 100%; width: 100%; border: none',
        src: Ext.String.format(Config.SYSTEM_VARIABLES.KB_SERVER_NAME, 'root_KBPortalWidget', 'WIDGETID=KB_Widget&KBCODES=KB_USER_GUIDE&SHOWALL=1'), 
      },
      id: frameId,
      listeners: {
        render: function() {
          var panel = this.up('panel');
          panel.mask('Loading');
          Ext.get(frameId).on(
            'load', 
            function() { 
              panel.unmask(); 
            });
          }
       }
    });
    return { layout: 'fit', items: cmp}
    


  8. Click the Save & Close button.
  9. Go to Forms and Pages → Detail Pages
  10. Open a Case Detail page.
  11. In the Case Detail Page Builder drag-and-drop a Form Viewer from the Tabs toolbox to the end of the tabs bar.
  12. In Add element – Tab pop-up window, select Coded Page from the Content Type drop-down list.
  13. In the Tab Title field type User Guide Help.
  14. In the Coded Page dropdown list under Coded Page Settings select the coded page built in the previous steps.
  15. Save the configuration
  16. Save the updated Case Detail Page
  17. Do a Preview and validate that the new tab shows the content of the KB
  18. Close the


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.