Hi there,
In my CRM 2016 8.1.0.359, I have an IFRAME which contains an HTML WebResource (a webpage with a simple button) on the main form of the entity "incident".
If I create a new incident (without saving it!) and then I click on this button, I open a new window (another HTML Page) in which I implemented a custom search using a 3th part web service.
When I found the record I need, I click on it and I want to set it into the lookup "customerid"
This is my fragment of code for creating the value to put into the lookup:
var object = new Array(); object[0] = new Object(); object[0].id = "{" + value + "}"; object[0].name = entityDisplayValue; object[0].entityType = entityName;
where value contains a GUID without the brench, entityName can be "account" or "contact" and entityDisplay name of the account or the contact.
At this point I tried the following 3 lines of code but without success:
window.parent.opener.parent.Xrm.Page.getAttribute("customerid").setValue(object); window.opener.parent.Xrm.Page.getAttribute("customerid").setValue(object); window.opener.parent.Xrm.Page.data.entity.attributes.get("customerid").setValue(object)
if I go in debug and I stop to the "getAttribute" I see in the console that the attribut is recognized but the .setValue do not have any effect and a .getValue always return null.
How can I solve this problem? Do you have any hints?
Thanks in advance for your help!
Gennaro
*This post is locked for comments