AXForum  
Go Back   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Forgotten Your Password?
Register Forum Rules FAQ Members List Today's Posts Search

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 24.02.2020, 20:13   #1  
Blog bot is offline
Blog bot
Участник
 
25,646 / 848 (80) +++++++
Join Date: 28.10.2006
a33ik: Available physical on exact dimensions
Источник: http://daxonline.org/1679-available-...imensions.html
==============

If case of following conditions
  • Item is enabled for advanced warehousing
    WHSInventEnabled::exist(ItemId);
  • some warehouses have negative stock
You will see that Available physical figure is different from what you most probably want to get:




In this case Available physical will display total value across all warehouses or any other dimensions you stated as a criteria.
Available physical on exact dimensions will display correct value considering specified dimensions.


Here is how to get correct values from X++:
static void VKAvailablePhysical(Args _args){ Qty qty; InventDim inventDim; InventDimParm inventDimParm; InventOnHandQty inventOnHandQty; ItemId itemId = '11011'; InventAvailabilityByUnit inventAvailabilityByUnit; WhsInventReserveQty whsInventReserveQty; InventIAvailability inventIAvailability; inventDim.clear(); inventDim.InventSiteId = 'SiteId'; inventDim.InventLocationId = 'Warehouse'; inventDim = inventDim::findOrCreate(inventDim); // Available physical inventDimParm.initFromInventDim(inventDim); inventOnHandQty = InventOnHandQty::newItemDim(itemId, inventDim, inventDimParm); qty = inventOnHandQty.availPhysical(); // Available physical on exact dimensions inventAvailabilityByUnit = inventAvailabilityProvider::findByItemIdDim(itemId, inventDim); inventIAvailability = inventAvailabilityByUnit.parmInventAvailability(); if (inventIAvailability is WhsInventReserveQty) { whsInventReserveQty = inventIAvailability as WhsInventReserveQty; qty = whsInventReserveQty.availPhysicalLevel(); }}







Источник: http://daxonline.org/1679-available-...imensions.html
 

Similar Threads
Thread Thread Starter Forum Replies Last Post
a33ik: AX2012: X++ Code to verify active stock dimensions on an item Blog bot DAX Blogs 0 03.10.2018 15:11
a33ik: Transfer order receive item with different than default storage dimensions Blog bot DAX Blogs 0 03.05.2018 18:12
stoneridgesoftware: How to Set up Required Dimensions in Dynamics 365 Business Edition Blog bot DAX Blogs 0 03.08.2017 00:13
dynamicsaxtraining: Get “available physical” values for specific item+dimensions per batch Blog bot DAX Blogs 0 17.10.2011 20:11
wiki.dynamicsbook: Changes Made in Navision Attain 3.60 Blog bot Dynamics CRM: Blogs 0 02.09.2008 13:23

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Рейтинг@Mail.ru
All times are GMT +3. The time now is 23:56.
Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Contacts E-mail, Advertising.