グローバル・コンテキストでのエージェント情報操作
このアクションは、グローバル・コンテキストおよびブラウザ・タブ・コンテキストで実行できます。
ログイン・エージェントの名の取得
TypeScriptの例を次に示します:
/// <reference path="uiEventsFramework.d.ts"/>
const frameworkProvider: IUiEventsFrameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('MyFirstExtensionID');
const globalContext: IGlobalContext = await frameworkProvider.getGlobalContext();
const requestObject: IOperationRequest = frameworkProvider.requestHelper.createPublishRequest('GetAgentInfo') as CX_SVC_UI_EVENTS_FRAMEWORK.IOperationRequest;
globalContext.publish(requestObject).then((message: IOperationResponse) => {
const response: IGetAgentInfoResponse = message as IGetAgentInfoResponse;
console.log(response.getFirstName()); // usage of getFirstName
});
JavaScriptの例を次に示します:
const frameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('MyFirstExtensionID');
const globalContext = await frameworkProvider.getGlobalContext();
const requestObject = frameworkProvider.requestHelper.createPublishRequest('GetAgentInfo');
globalContext.publish(requestObject).then((response) => {
console.log(response.getFirstName());
});
ログイン・エージェントの姓の取得
TypeScriptの例を次に示します:
/// <reference path="uiEventsFramework.d.ts"/>
const frameworkProvider: IUiEventsFrameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('MyFirstExtensionID');
const globalContext: IGlobalContext = await frameworkProvider.getGlobalContext();
const requestObject: IOperationRequest = frameworkProvider.requestHelper.createPublishRequest('GetAgentInfo') as CX_SVC_UI_EVENTS_FRAMEWORK.IOperationRequest;
globalContext.publish(requestObject).then((message: IOperationResponse) => {
const response: IGetAgentInfoResponse = message as IGetAgentInfoResponse;
console.log(response.getLastName()); // usage of getLastName
});
JavaScriptの例を次に示します:
const frameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('MyFirstExtensionID');
const globalContext = await frameworkProvider.getGlobalContext();
const requestObject = frameworkProvider.requestHelper.createPublishRequest('GetAgentInfo');
globalContext.publish(requestObject).then((response) => {
console.log(response.getLastName());
});
ログイン・エージェントのEメール・アドレスの取得
TypeScriptの例を次に示します:
/// <reference path="uiEventsFramework.d.ts"/>
const frameworkProvider: IUiEventsFrameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('MyFirstExtensionID');
const globalContext: IGlobalContext = await frameworkProvider.getGlobalContext();
const requestObject: IOperationRequest = frameworkProvider.requestHelper.createPublishRequest('GetAgentInfo') as CX_SVC_UI_EVENTS_FRAMEWORK.IOperationRequest;
globalContext.publish(requestObject).then((message: IOperationResponse) => {
const response: IGetAgentInfoResponse = message as IGetAgentInfoResponse;
console.log(response.getEmailAddress()); // usage of getEmailAddress
});
JavaScriptの例を次に示します:
const frameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('MyFirstExtensionID');
const globalContext = await frameworkProvider.getGlobalContext();
const requestObject = frameworkProvider.requestHelper.createPublishRequest('GetAgentInfo');
globalContext.publish(requestObject).then((response) => {
console.log(response.getEmailAddress());
});
ログイン・エージェントのユーザー名の取得
TypeScriptの例を次に示します:
/// <reference path="uiEventsFramework.d.ts"/>
const frameworkProvider: IUiEventsFrameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('MyFirstExtensionID');
const globalContext: IGlobalContext = await frameworkProvider.getGlobalContext();
const requestObject: IOperationRequest = frameworkProvider.requestHelper.createPublishRequest('GetAgentInfo') as CX_SVC_UI_EVENTS_FRAMEWORK.IOperationRequest;
globalContext.publish(requestObject).then((message: IOperationResponse) => {
const response: IGetAgentInfoResponse = message as IGetAgentInfoResponse;
console.log(response.getUserName()); // usage of getUserName
});
JavaScriptの例を次に示します:
const frameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('MyFirstExtensionID');
const globalContext = await frameworkProvider.getGlobalContext();
const requestObject = frameworkProvider.requestHelper.createPublishRequest('GetAgentInfo');
globalContext.publish(requestObject).then((response) => {
console.log(response.getUserName());
});
ログイン・エージェントのパーティIDの取得
TypeScriptの例を次に示します:
/// <reference path="uiEventsFramework.d.ts"/>
const frameworkProvider: IUiEventsFrameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('MyFirstExtensionID');
const globalContext: IGlobalContext = await frameworkProvider.getGlobalContext();
const requestObject: IOperationRequest = frameworkProvider.requestHelper.createPublishRequest('GetAgentInfo') as CX_SVC_UI_EVENTS_FRAMEWORK.IOperationRequest;
globalContext.publish(requestObject).then((message: IOperationResponse) => {
const response: IGetAgentInfoResponse = message as IGetAgentInfoResponse;
console.log(response.getPartyId()); // usage of getPartyId
});
JavaScriptの例を次に示します:
const frameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('MyFirstExtensionID');
const globalContext = await frameworkProvider.getGlobalContext();
const requestObject = frameworkProvider.requestHelper.createPublishRequest('GetAgentInfo');
globalContext.publish(requestObject).then((response) => {
console.log(response.getPartyId());
});