Hello!
We are developing AL scripts to POST Warehouse receipt\lines to MBC.
Warehouse receipts POST Api Page works fine
We are trying to develop AL script to POST Warehouse Receipt Lines.
We use following AL script for that (API Page)
page 50213 ApiPageWarehouseReceiptLine
{
PageType = API;
Caption = 'ApiPageWarehouseReceiptLine';
APIPublisher = 'Testing';
APIGroup = 'TestApi';
APIVersion = 'v1.0';
EntityName = 'WarehouseReceiptLine';
EntitySetName = 'WarehouseReceiptLine';
SourceTable = "Warehouse Receipt Line";
DelayedInsert = true;
DeleteAllowed = true;
InsertAllowed = true;
ModifyAllowed = true;
layout
{
area(Content)
{
repeater(GroupName)
{
field(number; "No.")
{
Caption = 'number';
}
field(binCode; "Bin Code")
{
Caption = 'binCode';
}
field(sourceDocument; "Source Document")
{
Caption = 'sourceDocument';
}
field(dueDate; "Due Date")
{
Caption = 'dueDate';
}
field(lineNo; "Line No.")
{
Caption = 'lineNo';
}
field(qtyToReceive; "Qty. to Receive")
{
Caption = 'qtyToReceive';
}
field(quantity; Quantity)
{
Caption = 'quantity';
}
field(sourceNo; "Source No.")
{
Caption = 'sourceNo';
}
field(sourceLineNo; "Source Line No.")
{
Caption = 'sourceLineNo';
}
}
}
}
}
When we filled in property SourceDocument we got error "Control 'sourceDocument' is read-only"
When we leave it empty we got error: "Source Document must be equal to 'Purchase Order' in Warehouse Receipt Line: No.={Number}, Line No.=0. Current value is ' '"
Can someone please tell us how we can POST Warehouse Receipt Lines to MBC via AL?