Skip to Content
0

Stock Transfer Draft with B1 WS

Jun 02, 2017 at 07:18 AM

66

avatar image
Former Member

Hello.

I'm trying to create an Stock Transfer Draft through DI-SERVER with help of B1WS.

Whenever I'm trying to specify batch numbers details I receive an error.

Anyone knows how to make the code below running.

Kind regards,

Pawel

Here is my code

StockTransferDraft.StockTransferDraftService std = new StockTransferDraft.StockTransferDraftService();
std.MsgHeaderValue = new StockTransferDraft.MsgHeader()
{
    ServiceName = StockTransferDraft.MsgHeaderServiceName.StockTransferDraftService,
    ServiceNameSpecified = true,
    SessionID = logRc
};

StockTransferDraft.StockTransfer request = new StockTransferDraft.StockTransfer()
{
    FromWarehouse = "01",
    ToWarehouse = "01",
    DocObjectCode = "67"
};
request.StockTransferLines = new StockTransferDraft.StockTransferStockTransferLine[1];
StockTransferDraft.StockTransferStockTransferLine ln = new StockTransferDraft.StockTransferStockTransferLine()
{
    LineNum = 0,
    LineNumSpecified = true,
    ItemCode = "0002-00001-36588",
    Quantity = 12.0,
    QuantitySpecified = true
};
ln.BatchNumbers = new StockTransferDraft.StockTransferStockTransferLineBatchNumber[1];
StockTransferDraft.StockTransferStockTransferLineBatchNumber batNr = new StockTransferDraft.StockTransferStockTransferLineBatchNumber()
{
    BaseLineNumber = 0,
    BaseLineNumberSpecified = true,
    Quantity = 12.0,
    QuantitySpecified = true,
    BatchNumber = "0001",
};
ln.BatchNumbers[0] = batNr;
request.StockTransferLines[0] = ln;
 
var rc = std.Add(request);
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers