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 :
Microsoft Dynamics AX (Archived)

Field automatically filled on form

(0) ShareShare
ReportReport
Posted on by

I have one form that contains something with field SomethindId, there is a button New.. that opens another form and creates a new record in the Something form. When that new form opens the field SomethingId has to  be automatically filled, which means I have to override the init method() on the new form. How can I write that?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    You  can write the code in the table initValue() method.

    table.SomethingID = "default value";

  • Community Member Profile Picture
    on at

    What should I wirte in "Default value"???

    cant understand :/

  • Rohin Profile Picture
    4,624 on at

    Do you want to generate automatically number seq for "somethingId" or want to populate with default value. Please explain with more details

  • Community Member Profile Picture
    on at

    I have one table that shows for example dormitories, there I have menuItem button that creates new building and opens another form. So when I select the dormitory with Id 5 for example when I create new building in that dormitory, the field dormitoryId in the new form has to be automatically filled with 5.

  • Community Member Profile Picture
    on at

    I have number seq. already, but that is not the question. Am I clearer now?

  • Suggested answer
    Rohin Profile Picture
    4,624 on at

    try to get the record on new form like this:

     buffer = element.args().record() // declare your table as buffer on class declaration of form which contains your fieldId

     now populate on your new form field:

        yourtablename.fieldId = buffer.fieldId;

  • Community Member Profile Picture
    on at

    I wrote that and it doesnt work, the field is not filled, there is drop down list to choose which dormitory I want, but i want the selected one dormitory and that Id to be on the field automatically filled.

    Doesnt work like this :/

  • Rohin Profile Picture
    4,624 on at

    i am assuming you put above all code in init() method of New form?

  • Community Member Profile Picture
    on at

    Yes I did that. Wrote that in the init  method on the new form that creates new recrord

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Basit Profile Picture

Basit 1

#1
GL-01081504-0 Profile Picture

GL-01081504-0 1

#1
Roya Profile Picture

Roya 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans