xrm-mock
xrm-mock copied to clipboard
Add empty lookup on form
Hi,
I am trying to add an empty lookup on form using:
XrmMockGenerator.Attribute.createLookup("parentaccountid", null);
then I try to find it on form using:
var formContext = XrmMockGenerator.getEventContext().getFormContext();
var lookupAttribute = formContext.getAttribute("parentaccountid");
var lookupAttributeValue = lookupAttribute.getValue();
I expect null ... but it returns an empty array I checked behavior on real Dynamics form (tried both: v8.2 and v9.2) - lookup attribute is on the form but has no value - in both (v8.2 and v9.2) formContext.getAttribute().getValue() returns null as expected What am I missing? Thank you!
Here is the original code for .createLookup() call from xrm-mock package