cancel
Showing results for 
Search instead for 
Did you mean: 

Batch Number Completion

Former Member
0 Kudos

Hello,

I am trying to update existing PO with batch numbers, but when I run my code nothing is happening.

Here is an example with a single row:

Set bO = oCompany.GetBusinessObject(oPurchaseDeliveryNotes)

bO.GetByKey (22)

bO.Lines.SetCurrentLine (0)

bO.Lines.ItemCode = "0007"

bO.Lines.Quantity = 5

bO.Lines.BatchNumbers.SetCurrentLine (0)

bO.Lines.BatchNumbers.BatchNumber = 14600012

bO.Lines.BatchNumbers.Quantity = 5

bO.Lines.BatchNumbers.Add

lreturncode = bO.Update()

Thanks, any help would be appreciated!

RGDS,

Zsolt

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks for your reply.

I am still using SDK6.5 and there is no update function for batchnumbers.

Probably I should update to 2004 SDK.

RGDS,

Zsolt

Former Member
0 Kudos

Hi Zsolt,

I think the time is right to upgrade. I didn't know there are people still using 6.5. 2005 is out now. 2004 has a lot of nice features that's not in 6.5. You won't regret it. 2005 of course is even better.

Hope it helps,

Adele

Former Member
0 Kudos

Hello Adele,

We have also a lot of trouble with 2004SDK.

So, I am careful with the upgrade in case of projects, already in production...

RGDS,

Zsolt

barend_morkel2
Active Contributor
0 Kudos

Zsolt,

If you are trying to update a PO line (adding batch numbers) you should use the update function for the line (and not add)

Try this:

Set bO = oCompany.GetBusinessObject(oPurchaseDeliveryNotes)

bO.GetByKey (22)

bO.Lines.SetCurrentLine (0)

bO.Lines.BatchNumbers.BatchNumber = 14600012

bO.Lines.BatchNumbers.Update

lreturncode = bO.Update()