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

Dynamically setting entire Form security access through Extension in D365FO

/// <summary> /// To check if user can get access to the Parameter form /// </summary> class SAN_ParamFormsAccessCtrl {     prot...