Hi Guys,
The below code shall help you to post the Purchase order line level Product receipt posting. Basically, its a partial Product receipt posting.
public static void main(Args _args)
{
Query query;
SysQueryRun queryRun;
QueryBuildDataSource qbds;
ttsbegin;
select firstonly1 purchLinePost
where purchLinePost.InventTransId == "xxxxx";
query = new Query(QueryStr(PurchUpdatePackingSlip));
qbds = query.dataSourceTable(tableNum(PurchLine));
qbds.addRange(fieldNum(PurchLine, RecId)).value(queryValue(purchLinePost.RecId));
queryRun = new SysqueryRun(query);
purchFormLetter = PurchFormLetter::construct(DocumentStatus::PackingSlip);
purchFormLetter.chooseLinesQuery(queryRun);
purchFormLetter.update(icPurchTable,icPurchTable.PurchId);
ttscommit;
}
Note: Use SysQueryRun object instead of QueryRun.
Happy Daxing!!
Regards,
Pradeep
The below code shall help you to post the Purchase order line level Product receipt posting. Basically, its a partial Product receipt posting.
public static void main(Args _args)
{
Query query;
SysQueryRun queryRun;
QueryBuildDataSource qbds;
ttsbegin;
select firstonly1 purchLinePost
where purchLinePost.InventTransId == "xxxxx";
query = new Query(QueryStr(PurchUpdatePackingSlip));
qbds = query.dataSourceTable(tableNum(PurchLine));
qbds.addRange(fieldNum(PurchLine, RecId)).value(queryValue(purchLinePost.RecId));
queryRun = new SysqueryRun(query);
purchFormLetter = PurchFormLetter::construct(DocumentStatus::PackingSlip);
purchFormLetter.chooseLinesQuery(queryRun);
purchFormLetter.update(icPurchTable,icPurchTable.PurchId);
ttscommit;
}
Note: Use SysQueryRun object instead of QueryRun.
Happy Daxing!!
Regards,
Pradeep
No comments:
Post a Comment