Description:-
There are three refreshing options available in AX "Refresh data", "Refresh AOD" and "Refresh dictionary". Many at times it is required that we trigger these events through code directly. For doing these following three classes can be used.
- SysFlushAOD
- SysFlushData
- SysFlushDictionary
Here is a
sample job which explains there usage
static void refreshOptions(Args _args) { Args args; ; /* * Please note after refreshing the AOD if you do not want infolog for the operation * create an object of Args and in parmEnum method pass NoYes::Yes */ newMenuFunction(menuitemactionstr(SysFlushAOD), MenuItemtype::Action).run(); /* * Please note refreshing the data if you do not the infolog for the operation * create an object of Args and in parmEnum method pass NoYes::Yes * In this case the infolog appears only in case of webSessions */ newMenuFunction(menuitemactionstr(SysFlushData), MenuItemtype::Action).run(); /* * Please note after refreshing the dictionary if you do not the infolog for the operation * create an object of Args and in parmEnum method pass NoYes::Yes (shown below for this option) */ args = new Args(); args.parmEnumType(enumnum(NoYes)); args.parmEnum(NoYes::Yes); newMenuFunction(menuitemactionstr(SysFlushDictionary), MenuItemtype::Action).run(args); }
Output:-
Thanks for comments.....