cancel
Showing results for 
Search instead for 
Did you mean: 

How to create locked batch numbers by di api

Former Member

Hi all, I wrote a code that generates a Purchase Delivery Notes document by DI api.

When i populate the .BatchNumbers property of document lines, i cannot set the batch number State (OBTN.State) and SAP create it in "released" state.

In some cases i need to create it in "locked" state. I did not find any property to set the status, nor any documentation on how to do this in the ref DI documentation.

How can i get the batchnumbers to be created with state other than "released"?

We know it can be modified manually through the Batch Details edit form but it does not fit our needs.

Code snippet:

With oPDN_Lines

If (Not isFirst) Then .Add() Else isFirst = False

.ItemCode = "ItemCode"

.Quantity = 1

.UoMEntry = 1

.RequiredDate = Now

.WarehouseCode = 1

With .BatchNumbers

.BatchNumber = "1234"

.ManufacturerSerialNumber = "4567"

.Quantity = 1

.AddmisionDate = Now

.ExpiryDate = Now

.Notes = "comment"

'THERE IS NO PROPERTY For Status???????????

End With

End With

Any help would be much appreciated, thanks

Regards,

alistair_moor
Discoverer

This funcionality would be very useful to have - many times I have needed to update some property of a batch using the DI

Accepted Solutions (0)

Answers (0)