MSCRM 2016中HTML Webreource中的XRM上下文 [英] XRM context in HTML webreource in MSCRM 2016

查看:83
本文介绍了MSCRM 2016中HTML Webreource中的XRM上下文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当单击某些功能区按钮时弹出HTML Web资源时,我面临一个问题。

I am facing a problem when HTML web resource which gets popped up on clicking of some ribbon button.

它没有Xrm上下文,因为它无法加载文件 clientglobalcontext.js.aspx

It does not have the Xrm context as it is unable to load the file clientglobalcontext.js.aspx

以下是我包含在HTML源代码中的内容:
src = ../ ClientGlobalContext.js.aspx
,还使用了
src = ClientGlobalContext.js.aspx

Here is what I have included in source of HTML: src="../ClientGlobalContext.js.aspx" and also used this src="ClientGlobalContext.js.aspx"

这可以在我当前的CRM11版本中使用,但不能在线加载CRM16中的负载。还有其他方法可以在弹出的html窗口中加载此文件,还是无法从CRM 2016中的单独HTML文件访问XRM上下文?

This is working in my current CRM11 version but it does not get load in CRM16 online. Is there any other way to load this file in a popped up html window or it is not possible to access the XRM context from separate HTML file in CRM 2016 ?

非常感谢您。

推荐答案

您需要考虑一些事情


  1. 不建议使用包含根WebResources文件夹的相对路径,例如/WebResources/ClientGlobalContext.js.aspx,因为这会导致页面在多租户环境中丢失组织上下文。 / li>
  1. Using a relative path including the root WebResources folder, for example, /WebResources/ClientGlobalContext.js.aspx, is not recommended because it can cause the page to lose organization context in a multi-tenant environment.

2。如果您将Web资源名称命名为 new_sample.html,则我们需要使用以下名称

2.If you have Web resource name as "new_sample.html" then we need to refer as below

 <script src="ClientGlobalContext.js.aspx"></script>


  1. 如果您有网站资源名称为 new_ / sample.html,那么我们需要引用以下内容

<script src="../ClientGlobalContext.js.aspx"></script>


  1. 如果您的Web资源名称为 new_ / content / sample.html,那么我们需要如下所示

<script src="../../ClientGlobalContext.js.aspx"></script>

这篇关于MSCRM 2016中HTML Webreource中的XRM上下文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆