Skip to main content

Notifications

Microsoft Dynamics AX forum
Answered

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!

  • 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,637 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.

Helpful resources

Quick Links

Community Spotlight of the Month

Kudos to Mohamed Amine Mahmoudi!

Blog subscriptions now enabled!

Follow your favorite blogs

TechTalk: How Dataverse and Microsoft Fabric powers ...

Explore the latest advancements in data export and integration within ...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 283,682 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,000 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,146

Featured topics

Product updates

Dynamics 365 release plans