gpt4 book ai didi

reactjs - 使用 React 构建 CRM Web 资源

转载 作者:行者123 更新时间:2023-12-02 03:14:14 25 4
gpt4 key购买 nike

我是新的 Dynamics CRM。我的项目包括表单提交和验证。我计划使用带有 Redux 前端的 React 和 CRM 的服务来构建一个产品。

构建 CRM Web 资源的 CRM 最佳实践是什么有人可以指导我吗?

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") );
});

最佳答案

  1. 获取上下文:
    • 添加ClientGlobalContext.js.aspxindex.html : <script type="text/javascript" src="ClientGlobalContext.js.aspx">ClientGlobalContext是 Dynamics 表单上下文的官方 Hook 。
    • 在 react 中componentDidMount生命周期,添加const context = GetGlobalContext();获取上下文对象。如果您使用 OpenWebResource 将数据发送到 WebResource (webResourceName, windowOptions, data),可以这样获取数据:JSON.parse(context.getQueryStringParameters().Data);
  2. 智能感知:如果您使用 TypeScript使用 d.ts(定义)文件:///<reference path=Xrm.V9.d.ts/> 。你可以得到它here

  3. 上传:WebRersource 不能为 jsxtsx类型。编译项目后,您应该只上传捆绑文件 (bundle.js)。

  4. 调试:如果要调试 jsx/tsx 文件,则需要使用 fiddler 的 AutoResponder 来使用源映射文件。 Here是一个解释。

关于reactjs - 使用 React 构建 CRM Web 资源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56622495/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com