【问题标题】:PowerApps: Use HTML to modify form display in model-driven apps?PowerApps:使用 HTML 修改模型驱动应用程序中的表单显示?
【发布时间】:2020-06-10 12:03:48
【问题描述】:

我需要修改模型驱动应用中的表单格式,使其更具可读性/直观性。目前,表单如下所示:

我尝试使用 Web 资源创建一个简单的 HTML 表格,其中包含 <script>Xrm.Page.getAttribute() 以拉入计划和实际列下的相关字段,但这不起作用。我设置了依赖项并将其分配给正确的表单元素,但没有运气。我使用的代码是这样的:

<div>  
  <table>
    <tr>
      <td><u>Tasks</u></td>
      <td><u>Planned</u></td>
      <td><u>Actual</u></td>
    </tr>
    <tr>
      <td>Task 1</td>
      <td><script>Xrm.Page.getAttribute("[plannedField_1]")</script></td>
      <td><script>Xrm.Page.getAttribute("[actualField_1]")</script></td>
    </tr>
    <tr>
      <td>Task 2</td>
      <td><script>Xrm.Page.getAttribute("[plannedField_2]")</script></td>
      <td><script>Xrm.Page.getAttribute("[actualField_2]")</script></td>
    </tr>
    <tr>
      <td>Task 3</td>
      <td><script>Xrm.Page.getAttribute("[plannedField_3]")</script></td>
      <td><script>Xrm.Page.getAttribute("[actualField_3]")</script></td>
    </tr> 
  </table>
</div>

这是修改表单输出的有效方法,还是有另一种/更好的方法来做到这一点,不涉及使用动态脚本 HTML 创建精细的解决方案?

【问题讨论】:

  • 你不需要HTML网络资源,只需使用所见即所得编辑器在一个选项卡下添加三个部分,然后在部分中添加属性。这不是读取 parent.Xrm 上下文和生成自定义动态 HTML 的方式
  • @ArunVinoth,感谢您的回复!我没有做所见即所得的原因是我正在尝试使用一个标签,其中包含与此相关的两个显示字段(计划的和实际的)。似乎没有一个选项可以在一列中做一个简单的标签,而在后两列中做一个字段。我错过了什么吗?
  • 看我的回答,这是我们能做的最大。否则您需要可编辑的子记录网格..

标签: dynamics-crm powerapps powerapps-modeldriven


【解决方案1】:

取消选中其中一个控件的Display label on the form

【讨论】:

  • 谢谢,@ArunVinoth!我无法获得 100% 的所见即所得选项,但您的示例为我提供了一种获得 90% 的方法 - 现在已经足够了!谢谢!!
猜你喜欢
  • 1970-01-01
  • 2021-06-14
  • 2020-03-12
  • 2021-08-20
  • 1970-01-01
  • 2013-03-16
  • 2017-02-02
  • 1970-01-01
  • 2022-08-17
相关资源
最近更新 更多