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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

get fieldid from control object on the form

(1) ShareShare
ReportReport
Posted on by 942
Hello,
 
I have dynamics ax 2009. I'm getting control object from the grid control via code and I need to get firldid of the field from the underlying table.
 
I wrote this:
 
  for(i=1;i<=_grid.controlCount();i++)
    {
        //control = element.form().design().controlNum(i);
        //gridControl = element.design().controlName(/MonitoringP150/);
        gridControl = _grid.controlNum(i);
        switch(gridControl.handle())
        {
            case classnum(FormIntControl):
                formIntControl = gridControl;
                fId = formIntControl.dataField();
                controlId = formIntControl.id();
                //fieldObj = this.dataSource().object(fId);
                break;
            case classnum(FormRealControl):
                formRealControl = gridControl;
                fId = formRealControl.dataField();
                controlId = formRealControl.id();
                break;
            case classnum(FormStringControl):
                formStringControl = gridControl;
                fId = formStringControl.dataField();
                controlId = formStringControl.id();
                break;
        }
 
fId = formIntControl.dataField() -  this method returns some id but that's not equal to id from the table field in AOT. is there any means to get the fieldid of the underlying table field?
 
any suggestions would be much appreciated
 
thanks.
I have the same question (0)
  • Martin Dráb Profile Picture
    238,149 Most Valuable Professional on at
    Isn't the value an extended field ID? If so, you can use fieldExt2Id() to convert it.

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

News and Announcements

Season of Giving Solutions is Here!

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 732 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 413 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 289 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans