I have a table called custom table with 7 fields, Custom Code datatype: Code; Custom Picture datatype: BLOB;
Expiry Date of type: Date, Toxity of type option: the options are , Caution, Danger, and Hazardous;
Custom Number of datatype: integer; Custom Description of type: text and Commission of type decimal.
From the option list the following code works perfectly on the onValidate() function:
I realized when "Custom Toxity" = 1 this is the option for Caution
I realized when "Custom Toxity" = 2 this is the option for Danger
I realized when "Custom Toxity" = 3 this is the option for Hazardous
because the first Option is an empty option string which the system regards as 0;
"Custom Description" := 'Caution';
IF "Custom Toxity" = 2 THEN
"Custom Number" := 6;
IF "Custom Toxity" = 3 THEN
Commission := 99.0;
IF updateCustomTable."Custom Toxity" = 1 THEN
updateCustomTable."Custom Description" := 'Caution';
IF updateCustomTable."Custom Toxity" = 2 THEN
updateCustomTable."Custom Number" := 6;
IF updateCustomTable."Custom Toxity" = 3 THEN
updateCustomTable.Commission := 99.0;
I also create a Codeunit in the in the C/AL of the Custom Test table in the Custom Toxity - OnValidate() as:
Custom Function.
*This post is locked for comments