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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

display method for date against itemid

(0) ShareShare
ReportReport
Posted on by 3,124

displaymethodforretestdateitemid.pngdatasourceforonhandform.pngdatasourceforonhandmacro.pngdatasourceforonhandmacrocode.png

Dear Experts,

I want to show Restest (same logic to manufacturing date or expiry date) against Item Number, right now we have manufacturing date and expiry date against the batch number.What will be the exact code. In above image i have given all code and datasource used for it, please check the above image. thanks in advance

Best Regards,

Shabir Ahmad

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    304,191 Super User 2026 Season 1 on at

    Hi Shabir,

    Which field in what table do you currently use for the restest? By the way, what is this date about?

  • Shabir Ahmad Profile Picture
    3,124 on at

    André Arnaud de Calavon

    RetestDate in inventbatch table and the date will be shown against item number, means in front of all item number there will be Retest date.

    Thanks and Regards,

    Shabir Ahmad

  • Pedro Tornich Profile Picture
    955 on at

    So, what exactly is not working for you?

    The way I see it, if you just duplicate the manufacturing date display method and change its return field, you should be able to use your new method as a display field on the form.

  • Shabir Ahmad Profile Picture
    3,124 on at

    2845.RetestDateforitemnumber.png

    Dear,

    Please check the above image as the batch number is not there so manufacturing date is also not showing even item number is there. I want to show Retest date on the bases of  item number for example if there is item number it must show Retest date in front of item number not to watching batch number. Right now display method is or field is on the bases of batch number namely showing manufacturing date on batch number bases but i want to show Retest date on Item number.

    Best Regards,

    Shabir Ahmad

  • Suggested answer
    Pedro Tornich Profile Picture
    955 on at

    Hi,

    You said that the RetestDate is a field on the InventBatch table, how can you select a record from the InventBatch table without having a batch number?

    The best you can do is to have the latest RetestDate or the earliest, which one best fits your business scenario.

    In both cases, instead of selecting a specific record from the InventBatch table you would need a select with min() or max() to retrieve the earliest or the latest date, respectively.

    For example, the following piece of code would get the latest RetestDate:

    select max(RetestDate) from inventBatch where inventBatch.ItemId == myItemId

  • Shabir Ahmad Profile Picture
    3,124 on at

    Dear Pedro Tornich,

    Thanks for your kind reply, and valuable suggestion. I want to show date(Rested Date column of date) on the bases of item number please check in the above comment i showed image and i put text on it as well to clear it more. As on on hand form manufacturing date is on the bases of batch number (in front of batch number there will be manufacturing date) like that i want to show the reteset date on the bases of item number in front of item number there must b Retest date.

    Best Regards,

    Shabir Ahmad

  • Pedro Tornich Profile Picture
    955 on at

    Is the Retest date a field of InventBatch table?

    I don't see that field in my environment, so I believe it's a custom field.

  • Shabir Ahmad Profile Picture
    3,124 on at

    Dear Pedro Tornich,

    Thanks for your reply, yes this custom field in inventbatch table in my enviroment, let suppose it is.

    what will be the code, if you can help me in this regard?

    Kindest regards,

    Shabir

  • Shabir Ahmad Profile Picture
    3,124 on at

    RetestDateforitemnumbernew.png

    Dear ,

    Now , you will understand what i want? check in the above image. The Batch number is blank related to batch number manufacturing date is also not showng. But item number is already there. I want to show as item number is there manufacturing date must be there, not to watch to batch number instead.

    Best Regards,

    Shabir Ahmad

  • Suggested answer
    Pedro Tornich Profile Picture
    955 on at

    Hi Shabir,

    Your requirement is clear. I understand that you want to show the Retest date by item independently of the batch number.

    But you didn't understand that it's not possible. Since you don't have the batch number, you can't select a record from the InventBatch table.

    Maybe it gets easier to understand if we stop discussing implementation and think about the business rule.

    Can you navigate to the Retest date on any of the records shown in your screen shot? If they don't have batch numbers, how would you know their Retest date?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 681

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 446 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 202 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans