หน้าเว็บ

วันจันทร์ที่ 7 พฤศจิกายน พ.ศ. 2559

Axapta : สร้าง Dialog Create Batch

Axapta : สร้าง Dialog Create Batch
- สร้างปุ่ม
- Code
  1. void clicked()
  2. {
  3.     Dialog              dl;
  4.     DialogField         dlfItemNo, dlfBatchId, dlfRun, dlfString, dlfNote;
  5.     FormStringControl   strBatchId;
  6.     ItemId              strItemNo;
  7.     InventBatch         inventBatch;
  8.     InventTable         inventTable;
  9.     PurchParmLine       purchParmLine;
  10.     int                 loop = 0;
  11.     inventBatchId       loopBatch;
  12.     int                 countBatch;
  13.     int                 findStrBatch;
  14.     str                 subStrFirstBatch;
  15.     str                 subStrLastBatch;
  16.  
  17.     ;
  18.     super();
  19.     //Find Not Work.
  20.     //strItemNo = PurchParmLine::findInventTransId(InventTransMovement.TransRefId,InventTransMovement.InventTransId).ItemId;
  21.     SELECT ItemId FROM purchParmLine
  22.     WHERE purchParmLine.PurchId == InventTransMovement.TransRefId
  23.         && purchParmLine.InventTransId == InventTransMovement.InventTransId;
  24.  
  25.     strItemNo = purchParmLine.ItemId;
  26.     strBatchId = element.design().control(control::InventoryDimensions_inventBatchId);
  27.  
  28.     // Check Inventory Dimension Group of the item.Only "WLB" use Batch.
  29.     SELECT * FROM inventTable
  30.     WHERE inventTable.ItemId == strItemNo;
  31.     if(inventTable.DimGroupId == "WLB"){
  32.         // Create dialog that Item number is prompted.Wait for BatchId.
  33.         dl = new Dialog("Create Batch");
  34.         dlfItemNo = dl.addFieldValue(0, strItemNo, "Item No.");
  35.         dlfBatchId = dl.addField(0, "Batch Id");
  36.         dlfRun = dl.addFieldValue(1, 1,"Run Number");
  37.         dl.addText("--------------------------------------------------------------------------------");
  38.         dl.addText("- ªèͧ Batch Id áÅÐ Run Number ËéÒÁÇèÒ§");
  39.         dl.addText("- ªèͧ Run Number ãÊèµÑÇàÅ¢·Õèµéͧ¡Òà RUN");
  40.         dl.addText("àªè¹µéͧ¡Òà Run 2 Batch ¡çãÊèªèͧ Run Number à»ç¹ 2");
  41.         dl.addText("       áÅéǤèÍÂä»àÅ×Í¡ Batch Number ·ÕÅÐ Line");
  42.         dlfItemNo.enabled(false);
  43.         if(dl.run() && dlfBatchId.value() != "" && dlfRun.value() != 0){
  44.            box::info("Code Run");
  45.         }
  46.     }
  47. }

ไม่มีความคิดเห็น:

แสดงความคิดเห็น