Hello,
I have used many of the BOI objects without any issues, but when retrieving inventory value with IM_ItemWarehouse_bus, none of the quantity is fetching correctly. It always returns 0 value, I am using ItemCode/WarehouseCode combination to set the lookup. My code snippet is given below.
oSS.InvokeMethod(ref errorLog, "nLogon";
oSS.InvokeMethod(ref errorLog, "nSetUser", new object[] { "XXXXXXXXX", "XXXXXXXXX"});
oSS.InvokeMethod(ref errorLog, "nSetCompany", "XXX");
oSS.InvokeMethod(ref errorLog, "nSetDate", "C/I", DateTime.Now.ToString("SageInputDateFormat".AppSetting()));
oSS.InvokeMethod(ref errorLog, "nSetModule", "C/I";
// Get the Task ID for the IM_Item_ui program
int TaskID = (int)oSS.InvokeMethod(ref errorLog, "nLookupTask", "IM_Item_ui";
oSS.InvokeMethod(ref errorLog, "nSetProgram", TaskID);
int resultVal = 0;
// Creating Item Warehouse business object
using (DispatchObject inventory = new DispatchObject(pvx.InvokeMethod(ref errorLog, "NewObject", "IM_ItemWarehouse_bus", oSS.GetObject())))
{
resultVal = (int)inventory.InvokeMethod(ref errorLog, "nSetKeyValue", "ItemCode$", "TEST001";
resultVal = (int)inventory.InvokeMethod(ref errorLog, "nSetKeyValue", "WarehouseCode$", "000";
resultVal = (int)inventory.InvokeMethod(ref errorLog, "nSetKey";
object[] arr1Results = new object[] { "BINLOCATION$", "" };
resultVal = (int)inventory.InvokeMethodByRef(ref errorLog, "nGetValue", arr1Results);//Giving correct value
object[] arr2Results = new object[] { "QUANTITYONHAND$", "" };
resultVal = (int)inventory.InvokeMethodByRef(ref errorLog, "nGetValue", arr2Results);
object[] arr3Results = new object[] { "TOTALWAREHOUSEVALUE$", "" };
resultVal = (int)inventory.InvokeMethodByRef(ref errorLog, "nGetValue", arr3Results);
....
Except for BINLOCATION and REORDERMETHOD, every other inventory quantities are returned '0'.