Solved

Called InventorySummaryInquiry from C#

  • 11 January 2022
  • 5 replies
  • 97 views

We have setup a Connected Service in C# to our WSE endpoint, I remember from previous work with Acumatica that to access a Generic Inquiry we need to utilize the Put request.  I am trying this on the InventorySummaryInquiry to get the list of locations available for an item but am getting an error saying the select, filter, expand and custom fields need to be supplied, if I attempt to supply values for each of these then it fails because I am not able to determine exactly what should be supplied for expand or custom.

Should I be using something else here?

InventorySummaryInquiry inquiryData = await inquiryClient.PutEntityAsync(new InventorySummaryInquiry() { InventoryID = new StringValue() { Value = e.RequestData.ItemName }, ExpandByLotSerialNbr = new BooleanValue() { Value = true } }, "", "", "", "");

 

The data specified in the request is invalid.

Status: 400
Response: 
{"message":"The request is invalid.","modelState":{"$select.String":["A value is required but was not present in the request."],"$filter.String":["A value is required but was not present in the request."],"$expand.String":["A value is required but was not present in the request."],"$custom.String":["A value is required but was not present in the request."]}}

icon

Best answer by cmarshall74 11 January 2022, 18:22

View original

5 replies

Ah okay, I determined that I need to pass in null for the select, filter, expand and custom values.  That stops the error.

The request is processing now, however, I am not getting anything back in the Results. If I don’t include the expand parameter then it returns a null Results object.

If I add “results” to the expand parameter then I get back a valid Results object with nothing in it.

InventorySummaryInquiry inquiryData = await inquiryClient.PutEntityAsync(new InventorySummaryInquiry() { InventoryID = new StringValue() { Value = e.RequestData.ItemName }, ExpandByLotSerialNbr = new BooleanValue() { Value = false } }, null, null, "results", null);
 

Results = {"ExpandByLotSerialNbr":{"value":false},"InventoryID":{"value":"AACOMPUT01"},"LocationID":{},"Results":[],"WarehouseID":{},"id":"5b56bf90-80c2-4fae-858e-c57fed31cf3f","rowNumber":1,"custom":{}}

 

Sorry for the basic questions, am getting back into the Acumatica arena after a time away.

Forgot to include screenshot of the result in Acumatica

 

 

Final update on this one, it is now working, not sure why it wasn’t after the changes as I haven’t done anything just came back to it to try again and now the results are being returned.

Userlevel 7
Badge

Hi @cmarshall74 thank you for sharing the solution and journey :slight_smile:

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved