Nothing happens the first time I select a /Name/ from the lookup field. When I remove the item /Name/ and select the /Name/ a second time, the below code then copies the quickview field into the form field.. Im unsure why this is happening. Any support would be appreciated
function OnLoad1(executionContext) { Xrm.Page.getAttribute(/nelep_studentapplication/).addOnChange(getQuickViewForm);}function getQuickViewForm(executionContext){var formContext = executionContext.getFormContext();var quickViewControl = formContext.ui.quickForms.get(/QuickviewControl1682435827537/);if (quickViewControl != undefined) { if (quickViewControl.isLoaded()) {// Access the value of the attribute bound to the constituent controlvar CourseInformation = quickViewControl.getControl(0).getAttribute().getValue();var CourseID = CourseInformation[0].id;var CourseName = CourseInformation[0].name;var CourseType = CourseInformation[0].entityType;formContext.getAttribute(/courseinformation/).setValue([{ id: CourseID, name: CourseName, entityType: CourseType }]); // Unit Group return; } else {setTimeout(getQuickViewForm, 1, executionContext); } } else { Xrm.Utility.alertDialog(/No data to display in the quick view control./); return; }}