Friday, March 10, 2017

mark/unmark checkbox Dynamics ax tree node on click




mark/unmark checkbox Dynamics ax tree node on click



public int mouseDown(int _x, int _y, int _button, boolean _Ctrl, boolean _Shift)
{
    ImageRes     stateImage;
    int idx,f;
    int ret;

    FormTreeItem formTreeItem ;
    FormTreeItem        parentNode;
     #FormTreeControl
    [idx,f]      = this.hitTest(_x,_y);

    FormTreeItem = this.getItem(idx);
    ret = super(_x, _y, _button, _Ctrl, _Shift);
    if (FormTreeItem)

    {
      switch(formTreeItem.stateImage())
     {
        case imageListAppl_checkbox.image(#ImageCheckNone):
        stateImage = imageListAppl_checkbox.image(#ImageCheckAll);
        formTreeItem.stateImage(stateImage);
        this.setItem(formTreeItem);
       
         break;
        case imageListAppl_checkbox.image(#ImageCheckAll):
        stateImage = imageListAppl_checkbox.image(#ImageCheckNone);
        formTreeItem.stateImage(stateImage);
        this.setItem(formTreeItem);
        
        break;
      }
   }
   Return ret;

}

No comments:

Post a Comment

D365FO. Dynamics 365 fiance and operation. Get and update contract of batch job on Controller run method. ax 2012

set Batch id in contract if batch isInBatch check is true in run method we will update the contract and set the batch id. class BrFunc...