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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)
Answered

Form InventOnhandItem and display modifier by two datasources

(0) ShareShare
ReportReport
Posted on by 961

Hello

There is a form InventOnhandItem. I want to display info of InventSerial.ProdDate into grid of InventOnhandItem. Normaly i would use display method modifier on one of the InventOnhandItem Data Sources (InventSum or InventDim) but InventSerial  relation needs InventSum.itemId and InventDim.InventSerialId.It is imposible to find InventSerial record using simple display modifier like this:

display InventSerialProdDate prodDate (inventSum _invSum)

or this

display InventSerialProdDate prodDate (InventDim _invDim)

 

Because I need both _invSum.itemId and _invDim.inventserialId. From InventDim_DS i cannot see current InventSum.ItemID or from InventSum_DS I cannot see InventDim.InventSerialId. I tried looking at InventDimCtrl_Frm_OnHand class with no luck :(

So what could be the solution to display InventSerial.ProdDate into InventOnhandItem form`s grid joining by InventSum.ItemId and inventDim.InventSerialId

 

*This post is locked for comments

I have the same question (0)
  • Lauras U Profile Picture
    961 on at

    Bump. Anyone? I don`t have a working solution yet :(

  • Community Member Profile Picture
    on at

    Hi Vukis,

    Why can't you write a display method?  You can get to inventDim from InventSum datasource by using the InventSum_DS.inventDim() method.

  • Lauras U Profile Picture
    961 on at

    Hi  Kent,

    Your suggestion works only when record becomes active. But after selecting another record date disapears. By the way I`m talking about opening InventOnhandItem for all items not for specific item.

  • Amir Nazim Profile Picture
    5,994 on at

    i also had the similar requirements, i created the display method on the InventSum table, i need to show the some field from ConfigTable table.

    ConfigTable( this.itemId, InventDim::find(this.inventDimId).ConfigId).someField.

  • Lauras U Profile Picture
    961 on at

    Thanks Amir, but it didn`t worked. I created display method directly on table, but this.inventDimId is empty. Are you sure you had your requirements on same form? Does the form had sums by inventdimParms?

  • Verified answer
    Lauras U Profile Picture
    961 on at

    Found solution myself. I used xrecord.joinChild();

    So the full solution:

      display InventSerialProdDate prodDate (inventSum _invSum)

       InventDim   invDim;

       ;

       invDim = _inventSum.joinChild();

       return InventSerial::find(invDim.inventSerialId,_inventSum.ItemId).ProdDate;

  • Ahmad Zbeeb Profile Picture
    150 on at

    Thanks a lot vukis, worked like a charm, this kept me dizzy for a while now

  • Brandon Wiese Profile Picture
    17,790 on at

    The reason that you can't just use inventSum.inventDim() or any variation on inventSum.inventDimId is because the InventOnhandItem form presents records that are grouped on fields like ItemId and various inventory dimensions.  When queries returned grouped results, only those fields which are grouped BY or aggregated have values, and InventDimId is not one of those fields (nor can it be) and so it is blank.

    Thus, using inventSum.joinChild() reveals the InventDim record that is associated with the InventSum record from the same query, and contains the needed InventLocationId, WMSLocationId, etc., and specifically in this case InventSerialId (if it is being grouped on).

  • Lam Tran Profile Picture
    500 on at

    Hi VUKIS,

    great post!Thanks

    Lam Tran,

  • Samy123 Profile Picture
    455 on at

    Brandon. I don't have much luck in my case:

    In my situation I need to display a field from InventItemLocation on the InventOnHandItem grid the InventItemLocation find method requires itemId AND InventDimId as parameters. I see there are both ItemId and InventDimId in InventSum datasource but InventDimId always blank. I tried to pass invDim.InventDimId as suggested above using joinChild() method but no luck it is always null or empty.

    Any suggestions ?

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 Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Sanhthosh.Kumar.K Profile Picture

Sanhthosh.Kumar.K 2

#2
Raed Salah Bzour Profile Picture

Raed Salah Bzour 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans