Thursday, October 10, 2024

Using SysOperationSandbox::callStaticMethod Sample in D365FO X++

 SysOperationSandbox::callStaticMethod(classnum(Classnum(<Class name>)), staticMethodStr(<Class name>, <Class static method name>), [<Parm1>, <Parm2>,<Parm3>], "<operation completion Message>");


 public static void updateOpr(container _callerParams)

 {

     if (conlen(_callerParams) != 3)

     {

         throw error("");

     }

     

     Anytype parm1 = conPeek(_callerParams, 1);

     Anytype parm2 = conPeek(_callerParams, 2);

     Anytype parm3 = conPeek(_callerParams, 3);        

        //Business Logic

 }

Disabling the flight in D365FO (CHD - Tier 1)

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