Axapta : Get or Set Checkbox value

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
public void clicked()
{
    Qty     tmpQty1;
    Qty     tmpQty2;
    FormCheckboxControl formCheckboxControl;
    ;
 
    super(); // ต้องรัน super ก่อน ไม่งั้นค่าไม่เปลี่ยน
// รับค่าจาก design
    formCheckboxControl = element.design().control(control::ProdParmHistoricalCost_EndJob);
//   box::info(strfmt("%1",formCheckboxControl.value()));
if(formCheckboxControl.value() == 1){ //ถ้า checked จะเป็น 1
    tmpQty1 = ProdTable::find(ProdParmHistoricalCost.ProdId).QtySched;
    tmpQty2 = ProdTableJour::reportedFinishedGood(ProdParmHistoricalCost.prodId);
 
    if(tmpQty1 != tmpQty2){
       if(box::yesNo("Sure?", DialogButton::Yes, "Confirm") == DialogButton::Yes)
       {
          if(box::yesNo("Sure?",DialogButton::Yes,"Confirm")== DialogButton::Yes){
            formCheckboxControl.value(true); //สั่งให้ checked
          }else{
            formCheckboxControl.value(false); //สั่งให้  ไม่ checked
          }
       }else{
        formCheckboxControl.value(false);
       }
    }
}
}


Written by Komkid on October 19th, 2009 with no comments.
Read more articles on Axapta and Programming.

Related articles

No comments

There are still no comments on this article.

Leave your comment...

If you want to leave your comment on this article, simply fill out the next form:

You have to be identified to write a comment.