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)

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

  • André Arnaud de Calavon Profile Picture
    307,769 Super User 2026 Season 2 on at

    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

    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
    307,769 Super User 2026 Season 2 on at

    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

    Hi Nitesh,

    This is not working for me.

  • Community Member Profile Picture
    on at

    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

    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans