Open the respective Knowledge Base search result using the openSearchResult API

var new = window.Sdk || {}; 
new.KBSearchOnResultOpened = function (executionContext) {
//Getting the formcontext
var formContext = executionContext.getFormContext();
//Getting field control
var productKBControl = formContext.getControl('Product_Knowledge_Base');
//Getting the user specified number
var count = formContext.getAttribute('new_searchresultcount').getValue(); //Calling the openSearchResult client API
var openResultStatus = productKBControl.openSearchResult(count);
//Setting the recordPresent field to Yes/No
openResultStatus == 1 ? formContext.getAttribute('new_countpresent').setValue(true) : formContext.getAttribute('new_countpresent').setValue(false);




Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store