by Riyaz » Tue Sep 26, 2017 4:55 pm
Hi Mike / Scott
Can you pls help me with this as I feel like am shooting in the dark with nothing to refer to. All I'm trying to do is to create a PO using the Jiwa 6 dll and I dont have class references, method references, etc, would really appreciate your help with a full example on creating a PO with dll.
Am using the code below, and I keep getting errors like this "Object variable or With block variable not set" , I think that means I havent assigned all required parameters, I would love to, but I dont know which all I need to assign. Below is my code again. I have try catch, the exceptions I get are pretty generic like the one above.
With PurchaseOrder
.Database = JiwaDatabase
.JLib = JiwaLib
.SystemProfile = JiwaSysProfile
.Reference = "1003670"
.CreditorID = strDebtorID
'1B2E5B064C5248909F34 is the ID for part no 81643-001
If .AddInventoryItem("1B2E5B064C5248909F34", newKey) = JiwaPurchaseOrder.enumJiwaPurchaseOrderReturnCodes.e_PurchaseOrderReturnCodeFailure Then
Throw New Exception(.ErrorMessage)
End If
If .NewOrder(strDebtorID, JiwaPurchaseOrder.eumJiwaPurchseSupplierType.eumCreditor) = False Then
Throw New Exception(.ErrorMessage)
End If
If Not .SaveOrder() Then
Throw New Exception(.ErrorMessage)
End If
End With