Announcements
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:
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.
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
To illustrate it more, I will put here an example picture and describe exactly what effect I plan to get
"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:
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?
André Arnaud de Cal...
294,241
Super User 2025 Season 1
Martin Dráb
232,982
Most Valuable Professional
nmaenpaa
101,158
Moderator