Dynamics 365 Blog - lookup - Microsoft Dynamics 365 for Finance and Operations

These posts are machine-translated.
Currently, only posts from category »Microsoft Dynamics 365 for Finance and Operations« are displayed Filter entfernen

Subscribe to RSS feed of this category
Currently, only posts are displayed, which contain the tag »lookup« Filter entfernen

Create lookup for simple unbound stringcontrol

The following code is intended to demonstrate how to add lookup functionality to a data-unbound StringControl.

[Control("String")]
class FormStringControl1
{
    public void lookup()
    {
        //super();
        SysTableLookup systableLookup =
            SysTableLookup::newParameters(tableNum(CustGroup), this);

        systableLookup.addLookupfield(fieldNum(CustGroup, CustGroup), true);
        systableLookup.addLookupfield(fieldNum(CustGroup, Name), false);
        systableLookup.performFormLookup();
    }
}

The next example is an extension of the above, but now a query is used to limit the values ??to be displayed.

[Control("String")]
class FormStringControl1
{
    public void lookup()
    {
        //super();
        SysTableLookup systableLookup =
            SysTableLookup::newParameters(tableNum(CustGroup), this);
        Query query;

        query = new Query();
        query.addDataSource(tableNum(CustGroup));

        query.dataSourceTable(tableNum(CustGroup)).addRange(
            fieldNum(CustGroup, CustGroup)).value("??");
        systableLookup.parmQuery(query);

        systableLookup.addLookupfield(fieldNum(CustGroup, CustGroup), true);
        systableLookup.addLookupfield(fieldNum(CustGroup, Name), false);

        systableLookup.performFormLookup();
    }
}

 

 


 
 
 

Override lookup of a field extending RecId

ScreenshotUsing the code example below, I want to show how to override the lookup method of a RecId/RefRecId field. Such a lookup is also referred to as a Referencelookup.

The example serves quite concretely to be able to select a financial dimension, but only one of the type cost center.


 
 
 

 

 
 
 
Posts of the actual month
Mai 2024
MoTuWeThFrSaSu
 12345
6789101112
13141516171819
20212223242526
2728293031 
 
© 2006-2024 Heinz Schweda | Imprint | Contact | German version | Mobile version
In order to provide you with better service, this site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.