0

I need to modify the format of a form in a model-driven app to make it more readable/intuitive. Currently, the form looks like this:

enter image description here

I tried to use a web resource to create a simple HTML table with <script> and Xrm.Page.getAttribute() to pull in the relevant fields under the planned and actual columns, but that isn't working. I set the dependencies and assigned it to the proper form element, but no luck. The code that I used is this:

<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>

Is this a valid way to modify form output, or is there another/better way to do this that doesn't involve creating an elaborate solution with dynamically scripted HTML?

Dave
  • 45
  • 6
  • You don't need HTML web resource for this, just use the WYSIWYG editor to add three section under one tab, then add the attributes in sections. This is not the way to read the parent.Xrm context & generate the custom dynamic HTML – Arun Vinoth-Precog Tech - MVP Feb 26 '20 at 15:13
  • @ArunVinoth, thanks for the response! The reason that I didn't do the WYSIWYG is that I'm trying to use one label with two displayed fields (planned and actual) pertaining to that. There doesn't seem to be an option to do a simple label in one column, and the fields in the second two columns. Am I missing something? – Dave Feb 26 '20 at 17:28
  • see my answer, this is the max we can do. Or else you need editable grid of child records.. – Arun Vinoth-Precog Tech - MVP Feb 26 '20 at 17:36

1 Answers1

1

Uncheck the Display label on the form for one of the controls.

enter image description here

enter image description here

enter image description here

Community
  • 1
  • 1
  • Thanks, @ArunVinoth! I can't get 100% of what I'd pictured with WYSIWYG options, but your example gave me a way to get 90% there - and that's good enough for now! Thanks!! – Dave Feb 27 '20 at 14:30