xrm-mock icon indicating copy to clipboard operation
xrm-mock copied to clipboard

Add empty lookup on form

Open romangobrey opened this issue 1 year ago • 0 comments

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 01

02

romangobrey avatar Mar 01 '23 06:03 romangobrey