Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

How can the values in FormGridControl be updated

(0) ShareShare
ReportReport
Posted on by 771

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

  • Santosh Singh Profile Picture
    Santosh Singh 771 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.

  • Verified answer
    Joris dG Profile Picture
    Joris dG 17,775 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.

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,622 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,354 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans