renderSearchPage (JavaScript API Reference) for Dynamics 365 Channel Integration Framework 2.0
Allows you to search among the records of a particular entity type. This API opens the Unified Interface entity page with the search field on it prepopulated with the search string that is passed as a parameter.
Syntax
Microsoft.CIFramework.renderSearchPage(entityLogicalName, searchString, correlationId, searchType).then(successCallback, errorCallback);
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| entityLogicalName | String | Yes | The entity logical name of the record you want to query such as "account". |
| searchString | String | No | String to search among the attributes of the entity records. |
| correlationId | GUID | No | The unique identifier for the RenderSearchPage event that was raised. |
| searchType | Boolean | No | Type of search page to open—0 for relevance search and 1 for categorized search. If no parameter is provided, the records are searched by category. |
| successCallback | Function | No | A function to call when some records are retrieved. |
| errorCallback | Function | No | A function to call when the operation fails. |
Return value
On success, returns a Promise object containing the attributes specified in the description of the successCallback parameter.
Examples
The following example shows how to query for the term "Contoso" among the records of an account entity by specifying the relevance search type.
var entityname = "account"
var searchterm = "Contoso"
var guid = "<use new guid for every api call>"
var searchtype = 0 // relevance search
Microsoft.CIFramework.renderSearchPage(entityname, searchterm, guid, searchtype).then(
function (success) {
console.log(success);
},
function (error) {
console.log(error);
}
);
The following example shows how to query for the term "Contoso" among the records of an account entity, without specifying the search type.
var entityname = "account"
var searchterm = "Contoso"
Microsoft.CIFramework.renderSearchPage(entityname, searchterm).then( // if search type is not passed, it defaults to categorized search
function (success) {
console.log(success);
},
function (error) {
console.log(error);
}
);
Feedback
Submit and view feedback for