Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Adding a calculated field to a form

Posted on by 115

So I am tasked with adding a field to the load details form.  However, I have no idea how the current set up is, and therefore do not know how to do this.  Let me explain.

loads1.PNG

Here we see the load details form.  Notice how the load it is showing details for is noted at the top.  For this load, the "Cartons shipped:" field calculates 27 in some fashion.  I need to do something similar for my new field.  However, I cannot figure out how the "Cartons shipped" value works.  I used personalize to find the field, and it's in the WHSLoadTable.  However, the I checked that field in that table but there is no useful information.

loads3.PNG

Normally, at this point, I use cross-reference, but I didn't find anything related to the WHSLoadTable form.

loads4.PNG

So I tried looking elsewhere and found this:

loads2.PNG

It looks like the bottom method of what I circled might be what I'm looking for.  However, cross-reference doesn't show any "used by" option for these methods, so I can't figure out where they are used.  What are these methods?  It looks like they are tied to the table?  I then tried checking the control flow of initializing and running the WHSLoadTable form, and was confused by this:

loads5.PNG

What is WHSLoadTable_ds?  I cannot find that anywhere.

Anyways, this whole thing is super confusing, and while I just need to know how to add a calculated field, I still think it's worth understanding the rest of it as well.  If anyone has any knowledge, I'd greatly appreciate it!

*This post is locked for comments

  • AXGreenHorn Profile Picture
    AXGreenHorn 115 on at
    RE: Adding a calculated field to a form

    Thanks again, Satish!  I decided to go with the display method and it got the job done.

  • Verified answer
    Satish Panwar Profile Picture
    Satish Panwar 14,645 on at
    RE: Adding a calculated field to a form

    Hi AXGreenHorn,

    The field that you show in screenshot above "Cartons shipped" is static field in the table. It was custom created (based on field properties you show).

    First you need to determine do you want a static field OR display method (Static - stored in database, display method - gets calculated on fly and then show the value based on some calculations).

    Assuming you need another field like Cartons shipped, add another field in the WHSLoadTable and show it on the form. It will be blank but you will be able to see it atleast.

    Now you need to see where the load field values are calculated, you need to add your calculation at same place. For e.g. select the HALoadCartons in table and click find references. it will probably show you where this is being set. if you can't find it, try searching the application for that field. once you know how, you can do similar calculation or get an idea and then proceed with your owns calculations. once set the values will be saved in database. When you open form next, it will show up on form as well.

    Thanks,

    Satish Panwar

    Please take time to click 'Yes' against the answers that help you guide in right direction to help other community members.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans