Page 1 of 1

How to get SoH for a specific part number

PostPosted: Tue Nov 11, 2014 4:37 pm
by gkov3
Hi All,
I am having slight issue with API Jiwa 7 with Demo Database, not sure if I am using this the right way.

The problem is that I need to find SOH for a particular part number.

So, in my program I have loaded Jiwa, logged in, and then loaded the Inventory module as below.

var invModule = app.BusinessLogicFactory.CreateBusinessLogic<JiwaFinancials.Jiwa.JiwaInventory.Inventory>();

After the loading the module I searched for a particular part number using the record id and it returns true.

if (!invModule.Find(IJiwaNavigable.ReadModes.Actual, "IN_Main.InventoryID", line.InventoryID, "")){
throw new Exception("Unable to find inventory item:" + line.InventoryID);
}

Next when I try to use invModule.SOHCollection to get the list of SOH, but it returns an empty collection.

If I check the Jiwa Application (GUI), it show the SOH items for the searched part number.

Is this the right way of getting list of SOH or I am doing this the wrong way?

Re: How to get SoH for a specific part number  Topic is solved

PostPosted: Tue Nov 11, 2014 5:15 pm
by Scott.Pearce
This is because we use lazy loading. Only when you click on the appropriate tab on the Inventory UI is the business logic told to load SOH information. This provides us with performance benefits. In your case, you should instruct the business logic to load the SOH information by issuing the call:

invModule.SOHCollection.Read(True, Nothing);

Reference documentation here

Re: How to get SoH for a specific part number

PostPosted: Tue Nov 11, 2014 5:40 pm
by gkov3
Thank you Scott. All good now.