web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Showing Date of Batches Form on On-Hand Form

(0) ShareShare
ReportReport
Posted on by 3,110

OnHandForm.pngRetestDateOnBatch.png

Dear Experts,

I want to show a date field name is "Retest Date" on On-Hand form( field the "Retest Date" Date is on Batches form inventory Management Module. )The field is on Batches form but i want same on (On hand Form) as well.

 

Thanks and Regards,

Shabir Ahmad

*This post is locked for comments

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    301,146 Super User 2025 Season 2 on at

    Hi Shabir,

    To get the correct results, you have to go deep in coding. The reason is that the form is not showing direct table result sets, but is showing calculated data based on aggregated queries. One row could potentially summarize multiple batch numbers. What is the business requirement to have this field on the on-hand form/what would be the purpose?

  • Verified answer
    Shabir Ahmad Profile Picture
    3,110 on at

    Thanks André Arnaud de Calavon for your reply and your view, the purpose of my this question was just to show a date of Batches form on On-Hand form same as this was our warehouse requirement. But the issue has been resolved by writing the below code on table then create a field on the certain grid and reference to table datasource(on that field property )  and data method:

    display InventBatchExpDate findInventBatchExpDate()

    {

      InventBatch   inventBatch;

       InventSum    inventSum;

      InventBatchId  InventBatchId;

      InventBatchExpDate  InventBatchExpDate;

       select  * from InventBatch where inventBatch.itemId == this.ItemId;

      return InventBatch.mod2RetestDate;

    }

    Thanks and Regards,

    Shabir Ahmad

  • André Arnaud de Calavon Profile Picture
    301,146 Super User 2025 Season 2 on at

    Hi Shabir,

    Thanks for your feedback. I don't think the coding is correct for some reasons. I'm sorry to say there are some major issues here:

    - It will return an unpredicted batch as this is not part of the where clause; you are only using the item ID as input.

    - You are getting as result a set with all records of the batches which belongs to this item. (performance degradation as no firstonly command is used in the select statement)

    - You are asking for all columns (*) and you are using only the mod2RetestDate. This is also a performance degradation.

    I would recommend to review and test carefully.

  • Shabir Ahmad Profile Picture
    3,110 on at

    RetestDateOnhandform.png

    Dear André Arnaud de Calavon,
    Thanks for sharing your valuable view and suggestion, i would like to know the correct code for this. Please would you share because the code which i shared has already done my work please check in the screenshot.As this was my requirement, if you have some other kind of code, so share i would definitely use that code as well. 


    Thanks and Regards,
    Shabir Ahmad

  • André Arnaud de Calavon Profile Picture
    301,146 Super User 2025 Season 2 on at

    Hi Shabir,

    I don't have an example available. Usually, I try to avoid adding it on this form, but make use of other forms for date information related to batch numbers. On e.g. a new form, you can join the Items, Batches, InventSum with the additional opportunity to sort and filter on date fields from the batch table. With a display method it is not possible.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans