我是新的 Dynamics CRM。我的项目包括表单提交和验证。我计划使用带有 Redux 前端的 React 和 CRM 的服务来构建一个产品。
构建 CRM Web 资源的 CRM 最佳实践是什么
有人可以指导我吗?
https://github.com/sonomapartners/web-resources-with-react https://github.com/sonomapartners/web-resources-with-react
import 'babel-polyfill';
import React from 'react';
import ReactDOM from 'react-dom';
import CaseSummary from './components/CaseSummary.jsx';
window.addEventListener('load', function onLoad() {
ReactDOM.render( <CaseSummary />,
document.getElementById("container") );
});
-
Get context:
- Add
ClientGlobalContext.js.aspx
在 在 在index.html
:
<script type="text/javascript" src="ClientGlobalContext.js.aspx">
. 客户端全局上下文 https://learn.microsoft.com/en-us/dynamics365/customer-engagement/developer/clientapi/reference/getglobalcontext-clientglobalcontext.js.aspx是 Dynamics 表单上下文的官方挂钩。
- 在反应中
componentDidMount
生命周期,添加const context = GetGlobalContext();
获取上下文对象。
如果您使用以下方式将数据发送到 WebResource开放网络资源 https://learn.microsoft.com/en-us/dynamics365/customer-engagement/developer/clientapi/reference/xrm-navigation/openwebresource(webResourceName, windowOptions, data),可以这样获取数据:JSON.parse(context.getQueryStringParameters().Data);
智能感知:如果你正在使用TypeScript
使用 d.ts(定义)文件:///<reference path=Xrm.V9.d.ts/>
。你可以得到它here https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/xrm/index.d.ts.
Uplaod: WebRersource 不能jsx
or tsx
类型。编译项目后,您应该只上传捆绑文件 (bundle.js)。
-
Debug:如果要调试 jsx/tsx 文件,则需要使用 fiddler 的 AutoResponder 来使用源映射文件。Here https://learn.microsoft.com/en-us/dynamics365/customer-engagement/developer/streamline-javascript-development-fiddler-autoresponder是一种解释。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)