| Santosh.'s profileDynamics AxPhotosBlogLists | Help |
|
June 18 Configuration Key Status Using X++ CodeAs we are aware, Configuration key controls access to specific feature. To know about the status of a configuration key, the user has to traverse Administration->Setup->System-> Configuration. Instead with the following job, a user can know the status of all the configuration keys that is being used in the system.
//Configuration key names and their enable state. static void ConfigurationKey(Args _args) { ConfigurationKeySet configKeySet; DictConfigurationKey dictConfigKey; Object formRun ; Map mapConfigKey; str strOutput; int i; ;
mapConfigKey = new Map(Types::Integer, Types::String); configKeySet = new ConfigurationKeySet(); configKeySet.loadSystemSetup();
for (i=1; i <= configKeySet.cnt(); i++) { dictConfigKey = new DictConfigurationKey(configKeySet.cnt2Id(i)); strOutput = dictConfigKey.enabled() ? "enabled:" : "disabled:"; strOutput += " " + " " + dictConfigKey.name(); mapConfigKey.insert(i, stroutput); }
_args = new Args(formstr(SysPick)); _args.parmObject(mapConfigKey);
formRun = classfactory.formRunClass(_args); formRun.init(); formRun.run();
formRun.setCaption('ConfigurationKey Status'); formRun.wait(); }
On executing this job, the output will be displayed in a SysPick form June 15 Validating TabPage Fields DynamicallyThis article is to my lovable sweetheart AnithaSantosh. I would like to share a small piece of information on validation stuff at form level. The requirement is something like doing basic validation. All fields at the form level needs to be filled in; else it needs to update the user that the specific fields’ information is missing. All the field validation is basically done at the table validate Field method. If the form design is changed time to time then the code also needs to be updated which isn’t a good practice. I took a small example to showcase how we can achieve the requirement. I have custTable form which maintains customer details and payment is important information which is required when we make any sales order. If the basic payment information is not filled in while creating customer details then system has to update the user that all details under payment tab needs to mandatorily filled in. 1) Set Auto declaration to ‘Yes’ for payment Tab under custTable form design
2) Under validateWrite of the custTable datasource add the following logic. for (i=1; i<= payment.controlCount (); i++) { if (payment.controlNum (i).valueStr () == '') { warning (strfmt ("%1, %2, %3", i, strdel (payment.controlNum (i).name (), 0, 8), 'Mandatory to be filled in.')); } } So basically before the Cust details are saved it checks whether all fields under payment Tab is filled else it will throw warning will the furnished details.
Note: No. indicates fieldNum This is just a basic information which i felt would be useful tip |
|
|