IUpdateSidePaneRequest
This object must be passed as the request object for update sidePane operation publish API.
Here's the syntax:
setVisibility(visibility: boolean): void;
Functions
setVisibility
Use this function to set visibility of the sidePane
icon:
setVisibility(visibility: boolean): void;| Parameter Name | Required? | Description |
|---|---|---|
| visibility | No | Visibility of the Side Pane icon. |
The following code sample shows an example in Typescript for updating side pane
operation to update section
visibility.
const updateSidePaneContext = async () => {
const uiEventsFrameworkInstance: IUiEventsFrameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
const sidePaneContext: ISidePaneContext = await uiEventsFrameworkInstance.getSidePaneContext('sidePaneId');
const payload:IUpdateSidePaneRequest = uiEventsFrameworkInstance.requestHelper.createPublishRequest('UpdateSidePane') as IUpdateSidePaneRequest;
payload.setVisibility(true);
sidePaneContext.publish(payload).then((response: IOperationResponse) => {
console.log(response)
}).catch(() => { })
}The following code sample shows an example in JavaScript for updating side pane
operation to update section
visibility.
const updateSidePaneContext = async () => {
const uiEventsFrameworkInstance = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
const sidePaneContext = await uiEventsFrameworkInstance.getSidePaneContext('sidePaneId');
const payload = uiEventsFrameworkInstance.requestHelper.createPublishRequest('UpdateSidePane');
payload.setVisibility(true);
sidePaneContext.publish(payload).then((response) => {
console.log(response);
}).catch(() => { })
}setSectionId
Use this function to set a different section for a sidePane which is already
customized to another section
ID.
setSectionId(sectionId: string): void;| Parameter Name | Required? | Description |
|---|---|---|
| sectionId | Yes | The section ID. |
The following code sample shows an example in Typescript for the side pane operation
to update section
ID.
const updateSidePaneContext = async () => {
const uiEventsFrameworkInstance: IUiEventsFrameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
const sidePaneContext: ISidePaneContext = await uiEventsFrameworkInstance.getSidePaneContext('sidePaneId');
const payload:IUpdateSidePaneRequest = uiEventsFrameworkInstance.requestHelper.createPublishRequest('UpdateSidePane') as IUpdateSidePaneRequest;
payload.setSectionId('newSectionId');
sidePaneContext.publish(payload).then((response: IOperationResponse) => {
console.log(response)
}).catch(() => { })
}The following code sample shows an example in JavaScript for the side pane operation
to update section
ID.
const updateSidePaneContext = async () => {
const uiEventsFrameworkInstance = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
const sidePaneContext = await uiEventsFrameworkInstance.getSidePaneContext('sidePaneId');
const payload = uiEventsFrameworkInstance.requestHelper.createPublishRequest('UpdateSidePane');
payload.setSectionId('newSectionId');
sidePaneContext.publish(payload).then((response) => {
console.log(response);
}).catch(() => { })
}setIcon
Use this function to set the icon of the
sidePane:
setIcon(icon: boolean): void;| Parameter Name | Required? | Description |
|---|---|---|
| icon | Yes | The icon symbol of the Side Pane. |
The following code sample shows an example in Typescript for updating the side pane
operation to update
icon.
const updateSidePaneContext = async () => {
const uiEventsFrameworkInstance: IUiEventsFrameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
const sidePaneContext: ISidePaneContext = await uiEventsFrameworkInstance.getSidePaneContext('sidePaneId');
const payload:IUpdateSidePaneRequest = uiEventsFrameworkInstance.requestHelper.createPublishRequest('UpdateSidePane') as IUpdateSidePaneRequest;
payload.setIcon('newIcon');
sidePaneContext.publish(payload).then((response: IOperationResponse) => {
console.log(response)
}).catch(() => { })
}The following code sample shows an example in JavaScript for updating the side pane
operation to update
icon.
const updateSidePaneContext = async () => {
const uiEventsFrameworkInstance = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
const sidePaneContext = await uiEventsFrameworkInstance.getSidePaneContext('sidePaneId');
const payload = uiEventsFrameworkInstance.requestHelper.createPublishRequest('UpdateSidePane');
payload.setIcon('newIcon');
sidePaneContext.publish(payload).then((response) => {
console.log(response);
}).catch(() => { })
}getContext
Use this function to get the context of the response object's context.
The following code sample shows the syntax for getContext
method.
getContext(): IObjectContext;The following code sample shows an example in Typescript for SaveRecord Operation
where getContext method is
used.
/// <reference path="uiEventsFramework.d.ts"/>
const frameworkProvider: IUiEventsFrameworkProvider =await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('MyFirstExtensionID');
const tabContext: ITabContext = await frameworkProvider.getTabContext();
const recordContext: IRecordContext = await tabContext.getActiveRecord();
const requestObject: CX_SVC_UI_EVENTS_FRAMEWORK.IOperationRequest = frameworkProvider.requestHelper.createPublishRequest('cxEventBusSaveRecordOperation');
recordContext.publish(requestObject: IOperationRequest ).then((message: IOperationResponse) => {
const response = message as ISaveRecordResponsePayload;
console.log(response.getContext()); // usage of getContext
}).catch((error: IErrorData) => {
console.log(error.getMessage());
}); The following code sample shows an example in JavaScript for SaveRecord operation
where getContext method is
used.
const frameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('MyFirstExtensionID');
const tabContext = await frameworkProvider.getTabContext();
const recordContext = await tabContext.getActiveRecord();
const requestObject = frameworkProvider.requestHelper.createPublishRequest('cxEventBusSaveRecordOperation');
recordContext.publish(requestObject).then((response) => {
console.log(response.getContext()); // usage of getContext
}).catch((error) => {
console.log(error.getMessage());
});