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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How can the values in FormGridControl be updated

(0) ShareShare
ReportReport
Posted on by

I am working on a project where i am required to update the values for a given row on a formGrid using a script. Here is what i am trying

    FormDateControl = form5604D4.design().control(12294);

    FormDateControl.dateValue( 10\02\2012 );

The dateControl is inside a grid i tried to debug and realized that the FormDateControl does get initialized however the dateValue is not reflected in the GridControl
I get no error message whatsoever. Appreciate your help 

*This post is locked for comments

  • Verified answer
    Joris dG Profile Picture
    on at
    Re: How can the values in FormGridControl be updated

    You should update the record buffer or the underlying bound values of the control, but never the control itself (definitely not on a grid).

    If you would update the value of the control and it's bound to a row in the database, it won't update it anyway.

    if your control is bound to a record you can just call the datasource by name and set the field, for example

    mydatasource.fieldname = 10\02\2012;

    Also, in the rare cases where you want to update a control on a form, don't use the control ID to get the control. Those are run-time numbers and not guaranteed to be the same. You can set the control's "autodeclaration" property to true, which allows you to access the control from code by name.

  • Santosh Singh Profile Picture
    on at
    Re: How can the values in FormGridControl be updated

    Dear Joris,

    Thanks for the reply and the valueable inputs. I did realize that i need to update the underlying datasource and not the control itself.

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans