Create PO via dll

Discussions relating to breakout scripting, .NET and COM programming with Jiwa objects.

Re: Create PO via dll

Postby Riyaz » Fri Aug 25, 2017 1:27 pm

Thanks for your help Scott
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: Create PO via dll

Postby Riyaz » Wed Aug 30, 2017 1:44 pm

Hi Scott

Still having some problems, seem to run again but still wont create any PO under JIWA, can you pls let me know the full script for creating PO in V6, how to add inventory items etc, would really appreciate that. Am using the below at the moment which executes fine

With PurchaseOrder
.Database = JiwaDatabase
.JLib = JiwaLib
.SystemProfile = JiwaSysProfile

If .NewOrder(strDebtorID, JiwaPurchaseOrder.eumJiwaPurchseSupplierType.eumCreditor) = False Then
Throw New Exception(.ErrorMessage)
End If

.Reference = "1003670"
.CreditorID = strDebtorID
.AddNonInventoryItem("81643-001", newKey)

'End With


If .SaveOrder() Then
Throw New Exception(.ErrorModule)
End If

End With
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: Create PO via dll

Postby Riyaz » Fri Sep 01, 2017 11:00 am

Hi Scott

Would you have anything for me on this pls?
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: Create PO via dll

Postby Riyaz » Mon Sep 11, 2017 12:02 pm

Hello

Can anyone pls reply to this thread?
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: Create PO via dll

Postby Mike.Sheen » Mon Sep 11, 2017 8:15 pm

Hi Riyaz,

This code looks wrong.

Code: Select all
If .SaveOrder() Then
   Throw New Exception(.ErrorModule)
End If


You only want to throw the exception if .SaveOrder() does NOT return true. So change it to:

Code: Select all
If Not .SaveOrder() Then
   Throw New Exception(.ErrorModule)
End If


And you'll probably want to throw with the .ErrorMessage property not the .ErrorModule property in order for the caller to properly display/react to the reason for any failure.

Mike
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2440
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 755

Re: Create PO via dll

Postby Riyaz » Tue Sep 12, 2017 4:19 pm

Hi Mike

Thanks for that, I'll give it a shot, can you pls also let me on how to add inventory items etc to the PO
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: Create PO via dll

Postby Scott.Pearce » Tue Sep 12, 2017 4:30 pm

Code: Select all
Dim newKey As String
Dim inventoryID as String = "00000000040000000002" 'Part no. 8100044

If .AddInventoryItem(inventoryID, newKey) = 0 Then
    Throw New Exception(.ErrorModule)
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 742
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 221

Re: Create PO via dll

Postby 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
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: Create PO via dll

Postby Riyaz » Mon Oct 02, 2017 2:10 pm

Hi Mike / Scott

Appreciate that you're busy, Anything on this pls as am progressing at all?
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Previous

Return to Technical / Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron