public SysLookupMultiSelectCtrl msCtrl; /// <summary> /// Building the DocuType query /// </summary> /// returns the Docutype Query public Query buildDocuTypeQuery() { Query docuTypeQry = new Query(queryStr(UCLRecipeGroupsQry)); return docuTypeQry; }[FormEventHandler(formStr(UCLModifierGroup), FormEventType::Initialized)] public void UCLModifierGroup_OnInitialized(xFormRun sender, FormEventArgs e) { Query docuTypeQry = this.buildDocuTypeQuery(); FormStringControl DocuTypes = this.design().controlName('UCLModifierGroupLine_UCLRecipeStoreGroups'); InventParameters inventParameters = InventParameters::find(); msCtrl = SysLookupMultiSelectCtrl::construct(this, DocuTypes, querystr(UCLRecipeGroupsQry), false, [tableNum(UCLRecipeStoreGroup), fieldNum(UCLRecipeStoreGroup,Name)]); msCtrl.refreshQuery(docuTypeQry); UCLModifierGroupLine line = this.dataSource(FormDataSourceStr(UCLModifierGroup, UCLModifierGroupLine)).cursor() as UCLModifierGroupLine; if(line.RecId) { msCtrl.set(this.getSelectedNotes(this.getSelectedFields())); } } public str getSelectedFields() { container selectedfields; str ret; UCLRecipeStoreGroup groupStore; while select groupStore { selectedfields+=groupStore.Name; } ret = con2Str(selectedfields,';'); return ret; } /// <summary> /// /// </summary> /// <param name=/sender/></param> /// <param name=/e/></param> [FormControlEventHandler(formControlStr(UCLModifierGroup, UCLModifierGroupLine_UCLRecipeStoreGroups), FormControlEventType::Modified)] public void UCLModifierGroupLine_UCLRecipeStoreGroups_OnModified(FormControl sender, FormControlEventArgs e) { FormRun formRun = sender.formRun(); UCLModifierGroupLine line = formRun.dataSource(FormDataSourceStr(UCLModifierGroup, UCLModifierGroupLine)).cursor() as UCLModifierGroupLine; if(Line) { line.UCLRecipeStoreGroups = con2Str(msCtrl.getSelectedFieldValues(), ';'); } }