Create Purchase Requsition - PR by X++

static void Create_PR(Args _args)
{
axPurchReqTable axPurchReqTable = new axPurchReqTable();
axPurchReqLine axPurchReqLine = new axPurchReqLine();
;
axPurchReqTable.parmPurchReqId();
axPurchReqTable.parmPurchReqName(“Testing create PR”);
axPurchReqTable.parmInventSiteId(“SiteID”);
axPurchReqTable.parmInventLocationId(“WarehouseID”);
axPurchReqTable.save();

axPurchReqLine.parmPurchReqId(axPurchReqTable.parmPurchReqId());
axPurchReqLine.parmItemId(“ItemCode”);
axPurchReqLine.parmCurrencyCode(“Currency”);
axPurchReqLine.parmPurchQty(Qty);
axPurchReqLine.save();
}