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 :
Microsoft Dynamics AX (Archived)

InventDimId: How to get InventDimId?

(0) ShareShare
ReportReport
Posted on by 174

Hi everyone, Am new to Dynamics 365. I am working on report "InventOnhand". Actually I have duplicated the report along with its table and classes, and I added two new fields in a table. I want to show data for two new added fields but for that i need "inventDimId" against each record so that I can initialize new fields against each record. But the problem is _inventDim.inventDimId and _InventSum.inventDimId in RPD class returns an empty string in each iteration while populating "inventOnhandTmp" table. Can anybody have an idea how to get inventDimId in RDP class for this report? 

code is added and I highlighted that line which returns empty string. Its a method of RDP Class and has been called from "processReport" method. I tried different tricks but didn't get useful results. 

private void insertTmpTable(InventSum _inventSum, InventDim _inventDim)
{

InventIAvailability inventAvailability = InventAvailabilityProvider::findBySumDim(_inventSum, _inventDim).parmInventAvailability();

inventOnhandTmp.ItemId = _inventSum.ItemId;
inventOnhandTmp.Deducted = _inventSum.Deducted;
inventOnhandTmp.Ordered = inventAvailability.ordered();
inventOnhandTmp.PostedQty = _inventSum.PostedQty;
inventOnhandTmp.Received = _inventSum.Received;
inventOnhandTmp.AvailOrdered = inventAvailability.availTotal();
inventOnhandTmp.AvailPhysical = inventAvailability.availPhysical();
inventOnhandTmp.ReservOrdered = inventAvailability.reservOrdered();
inventOnhandTmp.ReservPhysical = inventAvailability.reservPhysical();
inventOnhandTmp.AWC_CompanyLogo = FormLetter::companyLogo();


inventOnhandTmp.AWC_InventDimId = _inventDim.inventDimId;


// Fields might not have been selected on the specified buffers, or might have been updated since selection
_inventDim.checkInvalidFieldAccess(false);

inventOnhandTmp.InventDimFieldsMap::initAllDimensionsFrom(_inventDim);
inventOnhandTmp.insert();
}

*This post is locked for comments

  • André Arnaud de Calavon Profile Picture
    307,097 Super User 2026 Season 2 on at

    Hi Farwa,

    Can you explain how and why the two new fields are depending on the inventdimid? This field is empty because the results can be shown aggregated. E.g. the inventdim represents warehouse, location, color. If you want to have a report per warehouse and color, the quantity fields are summarized for multiple inventdim values. So this is the reason why the field is not used in the temporary table of the report.

  • Farwa Khizar Profile Picture
    174 on at

    Andre' Arnaud de Calavon,

    Actually i want to assign value to those new fields for each record but warehouse and site id can be the same of records but inventdimId against each record is not same. E.g I have added a field 'gate' and 'gateQuantity' so i want to fill these two fields for each itemId.

  • Verified answer
    Farwa Khizar Profile Picture
    174 on at

    Finally got how to get inventDimId within the inventOnhandDP class.

    InventOnhandNew inventOnhandNew; // new table having a field for inventDimId

    InventDim inventDim;

    inventDim = InventDim::findDim(_inventDim);

    //above line will return inventDim against every record according to dimensions, now we can assign this inventDimId to any other buffer, like

    inventOnhandNew.InventDimId = inventDim.inventDimId;

    [tag:HappyLearning]

  • Suggested answer
    Farwa Khizar Profile Picture
    174 on at

    Finally got how to get InventDimId in inventOnhandDP class

    //new table buffer having inventDimId field

    InventOnhandNew inventOnhandNew;

    //buffer for inventDim

    InventDim inventDim;

    //write below line in insertTmpTable method

    inventDim = InventDim::findDim(_inventDim);

    //now above line will return InventDim for each record having particular dimensions, we //can assign this inventDimId to new table buffer

    inventOnhandNew.InventDimId = inventDim.inventDimId;

    [tag:happy]Learning

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

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans