Showing posts with label D365 form. Show all posts
Showing posts with label D365 form. Show all posts

Thursday, August 1, 2019

More than one form was opened at once for lookup control. - solution


Issue: More than one form was opened at once for lookup control.

Resolution: The form control lookup can be extended to get desired lookup using below code:

[FormControlEventHandler(formControlStr(EcoResProductParameters, EcoResProductParameters_ProductEntityAttributeMasterCompanyId), FormControlEventType::Lookup)]
    public static void EcoResProductParameters_ProductEntityAttributeMasterCompanyId_OnLookup(FormControl sender, FormControlEventArgs e)
    {
        FormControlCancelableSuperEventArgs fccse = e as FormControlCancelableSuperEventArgs;
        SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(CompanyInfo), sender);
        Query query = new Query();
        query.addDataSource(tableNum(CompanyInfo));
        sysTableLookup.addLookupfield(fieldNum(CompanyInfo, DataArea));
        sysTableLookup.addLookupfield(fieldNum(CompanyInfo, TSTGlobalNumber));
        sysTableLookup.parmQuery(query);
        sysTableLookup.performFormLookup();
        fccse.CancelSuperCall();
    }

Fields are not visible in the form after adding field group in D365. - solution

Issue: Fields are not visible in the form after adding field group.

Resolution:  It might be due to "Data group" property. Try to clear the "Data group" property from the grid/group control, so that fields are visible in the form.