เขียนโปรแกรมใน Method Run หรือ int.
void init()
{
InventMaterial TableInventMaterial;
InventTableModule TableInventTableModule;
VendInvoiceTrans TableVendInvoiceTrans;
PurchTable TablePurchTable;
InventDim TableInventDim;
MaterialCode strMidItemId;
//ประกาศตัวแปร
FormStringControl strunitId, strmaterial, strAccountNum, strBatchnumber;
FormDateControl dateDeliveryDate;
;
super();
//เก็บค่าใส่ตัวแปร
strunitId = element.design().control(control::Unit);
strmaterial = element.design().control(control::Material);
dateDeliveryDate = element.design().control(control::DateEdit);
strAccountNum = element.design().control(control::AccountNum);
strBatchnumber = element.design().control(control::InventBacth);
///// Set default in form. ///////////
myItem = element.args().record();
strMidItemId = substr(myItem.ItemId,4,2);
SELECT * FROM TableInventTableModule
WHERE TableInventTableModule.ItemId == myItem.ItemId;
strunitId.text(TableInventTableModule.UnitId);
SELECT * FROM TableInventMaterial
WHERE TableInventMaterial.MaterialCode == strMidItemId ;
strmaterial.text(TableInventMaterial.MaterialSymbol);
SELECT * FROM TableVendInvoiceTrans
WHERE TableVendInvoiceTrans.ItemId == myItem.ItemId;
straccountNum.text(PurchTable::find(TableVendInvoiceTrans.PurchID).OrderAccount);
strBatchnumber.text(InventDim::find(TableVendInvoiceTrans.InventDimId).inventBatchId);
dateDeliveryDate.dateValue(Today());
}
ไม่มีความคิดเห็น:
แสดงความคิดเห็น