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

Announcements

No record found.

News and Announcements icon
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 1,172
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
    239,022 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

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 617

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 461 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 298 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans