Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

How to open Product Dimensions form?

(0) ShareShare
ReportReport
Posted on by 2

Hi guys,

I am trying to open the product dimensions from from a custom form using the following code

void clicked()
{
    EcoResProduct   ecoResProduct;
    Args            args = new Args();
    //super();

    ecoResProduct = EcoResProduct::find(InventTable::find(BOM.ItemId).Product);

    args.record(ecoResProduct);
    
    new MenuFunction(menuItemDisplayStr(EcoResProductMasterDimensionAction), MenuItemType::Display).run(args);

}


This opens the expected form but the data isn't filtered to the particular product I provied. Instead it is showing all the dimensions.

I have debugged through the init method of the Form 'EcoResProductMasterDimension' and the only thing it used from the args passed to it is the record 'EcoResProduct' which I am providing but it isn't working as expected.

Any ideas?

Thank you.

*This post is locked for comments

  • Suggested answer
    RE: How to open Product Dimensions form?

    OK I found out the problem.

    the form 'EcoResProductMasterDimension' takes the record from 'EcoResProductMaster' and not from 'EcoResProduct'. After passing the EcoResProductMaster buffer the dimensions filtered accordingly.

    Best Regards,

    Haris.

  • RE: How to open Product Dimensions form?

    Hi John,

    I tried adding the datasource (EcoResProduct) on the form and initialized it when modifying the itemId on my grid but it still gives the same result. Note that I don't need the EcoResProduct on the form it is just acting as a dummy.

    Regards,

    Haris

  • Johnkrish Profile Picture
    Johnkrish 781 on at
    RE: How to open Product Dimensions form?

    Hi Haris Adil,

    * First you have to use the EcoResProduct Table as your Datasource for the form. Then

    Try this code it will work.

    Here no need of using tihs -- EcoResProduct ecoResProduct;

    void clicked()
    {
    Args args = new Args();

    args.record(EcoResProduct);

    new MenuFunction(menuItemDisplayStr(EcoResProductMasterDimensionPerCompany), MenuItemType::Display).run(args);
    }

    Regards,

    Johnkrish.

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,433 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans