make validation about Discount

Hallo My name is malik from indonesian still junior dev and learning about platform outsystems

i need help about make discount validation like input:

price = 200.000

total_product = 2

All_price = 400.000

Discount = 10% -> with validation only decimal

total after discount = 360.000

Total_Bill = 360.000


what should i do if i have some question like this


Thank you very much if you help me

Hi there,


You need to set the data type of the variable/attribute to decimal.

So even if we give the input an integer it will be automatically converted into decimal (Type casting).


You can validate that either by showing a feedback message from the save action or by 

assigning the input validation message with the required message.

By default the input will have a predefined message which You can find in the Module properties and change them


ValidationMsg.PNG

thank you very much, i want ask question again about input phone number but only input number(no text or minus or plus)... what should i do?

Thank you Mr. Rashid

Hi,

For phone number set the datatype as phone number and it will automatically take digits no text no minus.

thank you Mrs prachi

i want ask about input validation name, if im input the same name twice and get some error message " user data has more than 2 names" what should i do ?

thank you

For this you have to implement a logic to compare (entered user name = names in the database)?

You can use many techniques for this.

For example, if you are using an entity with name attribute and it contain many name records you can filter it down with the input name( entityName.attributeName = inputname ). If the aggregate returns 0 records then you can permit to create a new entry. If it return any record then show an error feedback message.

You should go through the tutorial exercises. 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.