Single Row Select Lookup Ctrl in D365 F&O

Rumman Ansari   Software Engineer   2024-11-22 07:11:12   10  Share
Subject Syllabus DetailsSubject Details
☰ TContent
☰Fullscreen

Table of Content:

  • Override in ->[Form] --> [Grid] --> [FormControlString] --> [Method] --> lookup

[Form]
public class ANSARIPrductInclustionByWHS extends FormRun 
{
   
    [Control("String")]
    class ANSARIPrductInclustionByWHS_Brand 
    {
        public void lookup() 
        {
            super();
            SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(EcoResTextValue), this);
            Query q = new Query();
            QueryBuildDataSource qbdsText;

            qbdsText = q.addDataSource(tableNum(EcoResTextValue));
            sysTableLookup.parmQuery(q);
            sysTableLookup.addLookupfield(fieldNum(EcoResTextValue, TextValue), true);
            sysTableLookup.performFormLookup();
        }
    }

    [Control("String")]
    class ANSARIPrductInclustionByWHS_ItemGroup 
    {
        public void lookup() 
        {
            super();
            SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(InventItemGroup), this);
            Query q = new Query();
            QueryBuildDataSource qbdsText;

            qbdsText = q.addDataSource(tableNum(InventItemGroup));
            sysTableLookup.parmQuery(q);
            sysTableLookup.addLookupfield(fieldNum(InventItemGroup, ItemGroupId), true);
            sysTableLookup.performFormLookup();
        }
    }

     
        
    }
}