- สร้างปุ่ม
- Code
- void clicked()
- {
- Dialog dl;
- DialogField dlfItemNo, dlfBatchId, dlfRun, dlfString, dlfNote;
- FormStringControl strBatchId;
- ItemId strItemNo;
- InventBatch inventBatch;
- InventTable inventTable;
- PurchParmLine purchParmLine;
- int loop = 0;
- inventBatchId loopBatch;
- int countBatch;
- int findStrBatch;
- str subStrFirstBatch;
- str subStrLastBatch;
- ;
- super();
- //Find Not Work.
- //strItemNo = PurchParmLine::findInventTransId(InventTransMovement.TransRefId,InventTransMovement.InventTransId).ItemId;
- SELECT ItemId FROM purchParmLine
- WHERE purchParmLine.PurchId == InventTransMovement.TransRefId
- && purchParmLine.InventTransId == InventTransMovement.InventTransId;
- strItemNo = purchParmLine.ItemId;
- strBatchId = element.design().control(control::InventoryDimensions_inventBatchId);
- // Check Inventory Dimension Group of the item.Only "WLB" use Batch.
- SELECT * FROM inventTable
- WHERE inventTable.ItemId == strItemNo;
- if(inventTable.DimGroupId == "WLB"){
- // Create dialog that Item number is prompted.Wait for BatchId.
- dl = new Dialog("Create Batch");
- dlfItemNo = dl.addFieldValue(0, strItemNo, "Item No.");
- dlfBatchId = dl.addField(0, "Batch Id");
- dlfRun = dl.addFieldValue(1, 1,"Run Number");
- dl.addText("--------------------------------------------------------------------------------");
- dl.addText("- ªèͧ Batch Id áÅÐ Run Number ËéÒÁÇèÒ§");
- dl.addText("- ªèͧ Run Number ãÊèµÑÇàÅ¢·Õèµéͧ¡Òà RUN");
- dl.addText("àªè¹µéͧ¡Òà Run 2 Batch ¡çãÊèªèͧ Run Number à»ç¹ 2");
- dl.addText(" áÅéǤèÍÂä»àÅ×Í¡ Batch Number ·ÕÅÐ Line");
- dlfItemNo.enabled(false);
- if(dl.run() && dlfBatchId.value() != "" && dlfRun.value() != 0){
- box::info("Code Run");
- }
- }
- }
No comments:
Post a Comment