cancel
Showing results for 
Search instead for 
Did you mean: 

DdCheckException on 9.2 decimal value

Former Member
0 Kudos

Hi,

I've a field bound to a 9.2 decimal type (i.e.: 11 digits with 2 decimals). The problem is that if the user enters an incorrect value (e.g.: 3 decimals), the software raises a DdCheckException and terminates instead of warning the user with a contextual message.

Can someone suggest me a way to fix this problem?

Thank you,

Pietro

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Pietro

This is possible.

Follow these steps :

1) Create a simple type under Dictionaries->Local Dictionary->Data Types->Simple Types.

2) Provide any suitable name for the simple type and a suitable package.

3) Double Click on the simple type to open its properties.

4) By Default "Definition" tab properties will be opened.

5) Choose the Built-In Type as Decimal.

6) Put the value of "Total Digits" to 11 and "Fraction Digits" to 2. (these labels will come in red before values are provided and will bcome normal after both these values are provided)

7) Now open the properties under Representation tab (next to next to Definition tab)

😎 for the field "Format", enter #########.##

9) For the field "External length", provide the value 12.

10) Save and close the simple type editor.

11) Create a context attribute either in the component controller or view (as per requirement).

12) Assign the type of this attribute to this new simple type. (you need to browse Simple Type. The new simple type will be under the package that u had assigned while creating the simple type).

13) Create an inputField UI element in the View.

14) Map the value property of the InputField UI to this context attribute.

This should address your requirement.

Regards,

Sayan Ghosh

Former Member
0 Kudos

Thank you very much, Sayan. That solved the issue.

I made the new attribute with the custom datatype as a calculated attribute:

the get method reads the content of the original attribute

the set method writes the content to the original attribute with a try...catch block that prevents the write if the format is not legal.

See you,

Pietro

Answers (0)