web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to get a lookup on a dialog field using SysOpertation Framework

(0) ShareShare
ReportReport
Posted on by 518

Hello all,

How to get a lookup on a dialog field using SysOperation Framework.

Where we can write the code to get.

Thank You

Siddhant Singh

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mea_ Profile Picture
    60,284 on at

    Hi Siddhant Singh,

    It can be done using registerOverrideMethod, please refer for details devexpp.blogspot.com/.../dynamics-ax-custom-lookup-in-dialog.html

  • Siddhant Singh Profile Picture
    518 on at
    Miroshnikov,
    --------------------------------------------------------------------------------------
    Getting error.
    DialogField object not initialized.
    Stack trace
    (C)\Classes\CustVendOpenTransUIBuilder\postRun - line 12
    (C)\Classes\DictClass\callObject
    (C)\Classes\SysOperationController\callBuilderMethod - line 45
    (C)\Classes\SysOperationController\dialogPostRun - line 29
    (C)\Classes\SysOperationController\dialogShow - line 7
    (C)\Classes\SysOperationController\dialogRun - line 40
    (C)\Classes\SysOperationController\prompt - line 9
    (C)\Classes\SysOperationController\startOperation - line 9
    (C)\Classes\SysOperationServiceController\startOperation - line 16
    (C)\Classes\CustVendOpenTransController\main - line 9
    --------------------------------------------------------------------------------------
    and the code is this
    public void postRun()
    {
        DialogField                                  dlgFieldToBeOverridden;
        Kyt_CustVentOpenTransDC        dataContract;
        super();
        //dataContract = this.getDataContractObject();
        dlgFieldToBeOverridden = this.bindInfo().getDialogField(dataContract, methodStr(CustVentOpenTransDC, parmAccountNum));
        dlgFieldToBeOverridden.registerOverrideMethod(methodStr(FormStringControl, lookup), methodStr(CustVendOpenTransUIBuilder, myCustomLookup), this);
    }
  • Mea_ Profile Picture
    60,284 on at

    Hm, why did you comment out  //dataContract = this.getDataContractObject(); ?

    You need data contract. Then you need to check that dlgFieldToBeOverridden  is not null before calling any method on it.

  • Siddhant Singh Profile Picture
    518 on at

    Actually I want the lookup on the dialog is from the table CustTrans.

    What all changes I have to do to get that. Can you please tell me.

  • Suggested answer
    krishna.rao@dax Profile Picture
    3,006 on at

    Hi Siddhant,

    As Ievgen said, don't comment contract class object.

    1. create lookup method, you might need to use group by for accountNum display

       looks like below code//use custTrans table, group by on AccountNum

    public void lookupCustGroup(FormStringControl _formStringControl)

    {    

       Query query = new Query();

       QueryBuildDataSource DS;    

       SysTableLookup sysTablelookup;

       //create a table lookup    

       sysTablelookup = SysTableLookup::newParameters(tableNum(CustGroup),_formStringControl);

       sysTablelookup.addLookupfield(fieldNum(CustGroup,CustGroup));

       //create a query

       DS = query.addDataSource(tableNum(CustGroup));

       //assign the query and call lookup

       sysTablelookup.parmQuery(query);

       sysTablelookup.performFormLookup();

    }

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans