Sunday, July 3, 2016

User restrict to close Form ax 2012

//User restrict to close Form
//for Direct Datasource
1) intialize new boolean vairable in class declaration of Form method
2) ok - clicked method -->  (below Super())
   ok = true;
   Cancel = False;
   element.close();
3) Cancel - clicked Method -->  (below super())
   ok = false;
   Cancel = true;
   element.close();
4) Form-Close-->
   if(!ok && !Cancel)
    {
        throw warning("Click Ok to confirm or else Cancel to Discard");
    }
    if(Cancel)
    {
        if (numberSeqFormHandler)
        {
            numberSeqFormHandler.formMethodClose();
        }
 datasource.delete();
    }
    if(ok)
    {
        datasource.write();
    }
    super();

No comments:

Post a Comment

Copy Markup charges while posting purchase invoice using X++

 Copy Markup charges while posting purchase invoice using X++ Class: Important: Code logic is just for Reference.  New class => Duplicate...