1

I have created a custom web resource (HTML File), that has a text area and a submit button. I call this web resource in this way :

Xrm.Utility.openWebResource("new_simple_modal", null,320, 320);

The name of the HTML File is new_simple_modal. When I press a ribbon button, the modal appears. I call this modal from Campaign entity via a custom ribbon button. Now, I want that when the submit button clicked, the text entered to the modal, appear in one filed of the campaign record that is already opened. And also want to change the statuscode of the Entity. How ever, I need to access that button of HTML Resource file, Or access The record entity that is opened. I tried this in the HTML file :

Xrm.Page.data.entity.getAttribute("crmfieldname")=value;
parent.Xrm.Page.data.entity.getAttribute("crmfieldname")=value;
window.parent.Xrm.Page.data.entity.getAttribute("crmfieldname")=value;

But no success, Can I access HTML Element from The entity? I want to use onClick of the button, How can I access that? Any help will appreciate.

Alireza
  • 179
  • 1
  • 2
  • 11

1 Answers1

1

That's not the correct way to set a field value.

Use this: Xrm.Page.getAttribute("crmfieldname").setValue(value)

James Wood
  • 17,286
  • 4
  • 46
  • 89