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

Disabling the flight in D365FO (CHD - Tier 1)

 INSERT INTO dbo.SYSFLIGHTING(FLIGHTNAME, ENABLED)  VALUES ('<FlightObjectName>_KillSwitch', 1)  or  INSERT INTO dbo.SYSFLIGHT...