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)

Set Default Value for a Custom field , based on Production Status value "Created"

(0) ShareShare
ReportReport
Posted on by

In production control -> all production orders 

For any Production order status value is "Created" then my custom field value should be set as "Hold".  How can i do that.

*This post is locked for comments

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    299,956 Super User 2025 Season 2 on at
    RE: Set Default Value for a Custom field , based on Production Status value "Created"

    Hi Divija,

    You need to do this with some x++ logic. You can have a look at the method 'update' on the table ProdTable. This calls logic in classes ProdStatusType and ProdTableType with some inherited classes per production status and type. You can see which method on the ProdStatusType_Created is always called and add the logic here. You can also create new methods for you new field.

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Set Default Value for a Custom field , based on Production Status value "Created"

    you need to override the modifiedfield method of the table (prodTable)

    write the code to assign "Hold" value to your custom field if Production order status field is having value "Created"

    Please verify and let me know if you need more details

  • André Arnaud de Calavon Profile Picture
    299,956 Super User 2025 Season 2 on at
    RE: Set Default Value for a Custom field , based on Production Status value "Created"

    Hi Nitesh,

    Please note that the modified field is not executed when fields are changed in methods. Is it is executed when a field is modified in a form or Web form. As the Production status is not handled on the form contol for production orders, your solution will not work in this case.

  • Community Member Profile Picture
    on at
    RE: Set Default Value for a Custom field , based on Production Status value "Created"

    Hi Nitesh,

    This is not working for me.

  • Community Member Profile Picture
    on at
    RE: Set Default Value for a Custom field , based on Production Status value "Created"

    Hi Calavon,

    we can do that by x++ code but where to place the code. I am not getting.

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Set Default Value for a Custom field , based on Production Status value "Created"

    other simpler way could be to write your logic in insert() and update() method of the table

    problem with this if in standard logic doinsert() or doupdate() method is used for insert and update of record then there will be issue.

    But you can try.

    Please verify and update us with your findings

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)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
NNaumenko Profile Picture

NNaumenko 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans