Avoid displaying decimal & notations and not allow text values in numeric or amount fields in C4C-SDK
Below blog describes how to prevent displaying decimals and notations for Amount, Integer or other numeric values in UI field. At the same time it shouldn’t allow text values (string) too in the field.
Following are the steps to achieve:
Create additional description element (LANGUAGEINDEPENDENT_MEDIUM_Name) in BO along with amount or integer or other numeric element.
Open UI screen where you want to prevent displaying decimal and notations.
In Data Model, drag BO numeric element and description element (as a field) to under Root node.
In Design, drag only numeric element to the UI screen (as usual the way by adding fields to UI screen from the data model tab).
In Data Model, select numeric element (field) and select ‘Properties” tab. Change the “CCTS Type = identifier”. Go to Behavior “Dependent Fields = assign the description field here”
Save and activate.
Below is the result of the above solution.
The above UI field ‘Customer Purchase Order No’ displays value without decimals and no space between digit to digit. It allows only digits (numeric) now.
Conclusion: The above approach will help you to define pure numeric UI values without decimals and also not allow for text entries.
Thanks for reading the blog post.