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

Convert Call stack to readable format in D365FO X++

//Input --container _xppCallStack = xSession::xppCallStack();  Public static str POL_formatXppCallStack(container _xppCallStack, int _skipFr...