Personalized Community is here!
Quickly customize your community to find the content you seek.
Now Available in Community - New TechTalk Videos for 2021
2021 Release Wave 2Discover the latest updates and new features releasing from October 2021 through March 2022.
2021 release wave 2 plan
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Upcoming TechTalks | All TechTalks
I have to get the Ordered, Reserved and Inventory values for a specific product and InventLocationId that is shown on the InventoryLookupView.
I have tried in the CRT: GetItemAvailabilitiesByItemWarehousesServiceRequest/Response and GetItemAvailabilitiesDataRequest/EntityDataServiceResponse<ItemAvailability>.
All of them just returns a value in the ItemAvailability.AvailableQuantity field. none on the PhysicalReserved and OrderedSum. Even the AvailableQuantity doesn't correspond with what is shown in the InventoryLookupView.
Can anybody tell me what the request/response is that is actually behind orgUnitAvailability.ItemAvailabilities?
The InventoryLookupView should ultimately call the SearchOrgUnitAvailabilitiesServiceRequest.
Thank you for using Microsoft Dynamics Communities,
SR SUPPORT ENG
Microsoft Dynamics AX / Dynamics 365 Commerce
If my information answers your question please click 'Yes' against "Did this answer your question?" to help other community members.
Thank you SO MUCH for this information Juliet.
I was able to use it in my CRT trigger and I finally have the same quantities that is shown in inventory lookup view. I tried for the longest time to get the same quantities with a SQL view script but there was always an issue somewhere with some product that it just doesn't gave the same quantities.
For those that need to also add custom columns to show the same quantities that is on Inventory lookup, like I had to do for the product search view, here is what I did.
I added a public class in my CRT project and extended it from IRequestTrigger:
GetProductSearchTriggers : IRequestTrigger
I added support request type: GetProductSearchResultsDataRequest, because I had to do it for the product search view.
For the onExecuted method I looped through the products returned by the GetProductSearchResultsDataResponse and called the trigger Juliet gave me. It doesn't have a response , so I used the generic EntityDataServiceResponse but for entity OrgUnitAvailability.
I added extension properties to each product specific for the 3 quantities, but I assume one can add the OrgUnitAvailability as an extension property and then on the POS side pulls out the values.
public void OnExecuted(Request request, Response response)
var productsList = ((EntityDataServiceResponse<ProductSearchResult>)response);
foreach (ProductSearchResult product in productsList)
OrgUnitAvailabilitySearchCriteria srchCriteria = new OrgUnitAvailabilitySearchCriteria();
srchCriteria.OrgUnitName = request.RequestContext.GetOrgUnit().OrgUnitName;
srchCriteria.OrgUnitNumber = request.RequestContext.GetOrgUnit().OrgUnitNumber;
SearchOrgUnitAvailabilitiesServiceRequest availRequest = new SearchOrgUnitAvailabilitiesServiceRequest(
product.RecordId, srchCriteria, QueryResultSettings.AllRecords);
EntityDataServiceResponse<OrgUnitAvailability> availResponse =
PagedResult<OrgUnitAvailability> extensions = availResponse.PagedEntityCollection;
IEnumerable<ItemAvailability> fList = new List<ItemAvailability>();
foreach (OrgUnitAvailability obj in extensions)
fList = obj.ItemAvailabilities;
foreach(ItemAvailability vI in fList)
iQty += vI.AvailableQuantity;
rQty += vI.PhysicalReserved;
oQty += vI.OrderedSum;
CommerceProperty availPhys = new CommerceProperty();
availPhys.Key = "Inventory";
availPhys.Value = iQty.ToString("0.####");
CommerceProperty reserveQty = new CommerceProperty();
reserveQty.Key = "Reserved";
reserveQty.Value = rQty.ToString("0.####"); ;
CommerceProperty orderQty = new CommerceProperty();
orderQty.Key = "Ordered";
orderQty.Value = oQty.ToString("0.####"); ;
Business Applications communities