将更新的应用上下文发送到智能 Microsoft 365 Copilot 副驾驶®侧面板。
Syntax
Xrm.Copilot.updateContext(context).then(successCallback, errorCallback);
Parameters
| 参数名称 | 类型 | 必需 | Description |
|---|---|---|---|
context |
PowerAppsContent | 是的 | 描述要发送到智能 Microsoft 365 Copilot 副驾驶®侧面板的当前应用上下文的对象。 |
successCallback |
函数 | 是的 | 作成功时要调用的函数。 |
errorCallback |
函数 | 是的 | 作失败时要调用的函数。 |
返回值
类型:Promise<void>
Remarks
API 自动合并基本上下文字段(appId、、appTypeorgId、geoschemaVersion)。 无需提供这些字段。 如果未启用智能 Microsoft 365 Copilot 副驾驶®,API 将不执行任何操作。 你创作的代理尚无法使用上下文来优化其响应。
Example
await Xrm.Copilot.updateContext({
entity: "account",
filterXML: "<fetch><entity name='account'><filter><condition attribute='statecode' operator='eq' value='0'/></filter></entity></fetch>"
});