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 :
Finance | Project Operations, Human Resources, ...
Unanswered

Rearrange/Move grid column control layout

(0) ShareShare
ReportReport
Posted on by 15

Is there a way to change column position by X code?

I created one field in grid by code

formBuildGroupControl = element.form().design().control('Grid');
formBuildStringControl = formBuildGroupControl.addDataField(formBuildDataSource.id(), fieldNum(MyTable, MyField));
formBuildStringControl.name('ValueColumn');

adn the other one is created by AOT:

pastedimage1615987158519v1.png

My problem is that the "InvoiceAccount" field appears in the first place on the grid, and the field I created appears in the second place.
My goal is to find a way to move "InvoiceAccount" to the last place on the grid.

The last thing I would like to do is move the code, because I also work on standard code which also creates dynamic fields. The best solution for me would be to move this one field, instead of 5 dynamic fields.

I was looking for a solution to the problem in "FormBuildStringControl", unfortunately there is no method there that could help me.

I have the same question (0)
  • Lukasz3 Profile Picture
    15 on at

    To illustrate it more, I will put here an example picture and describe exactly what effect I plan to get

    pastedimage1616058889079v1.png

    "Customer Account" is a field created in AOT (image presented in my first message)
    "Project contract ID" is a field created by code (code presented in my first message)

    These two fields are lookup fields placed in the Financial dimension form, and I can't just drag them right or left.
    My goal is to do this:

     2021.03.18-10.12.13.925.png

    It looks so simple, but I can't find a way to achieve it. When I try to put code that creates the "Project contact ID" field after super() in form's init (because now it's in front of super() ), my application just crash without a message.
    I also tried to find an array that specifies the position of the fields in the grid, but there is no such table.

    Has anyone faced the same problem before me?

  • ToddB Profile Picture
    on at

    Hi Lukasz3,

    Are you able to move this with the New Grid Control ?

    New grid control

    docs.microsoft.com/.../dynamics365-release-pla

    n/2020wave2/finance-operations/finance-operations-crossapp-capabilities/new-grid-control--general-availability

    Grid capabilities

    docs.microsoft.com/.../grid-capabilities

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

#1
Martin Dráb Profile Picture

Martin Dráb 559 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans