29
Views
5
Comments
how to prevent blank values from saving
Question
Application Type
Reactive

I have added an if condition to check if the tankname is empty or not and if it is empty then a message is shown to the user that enter a tankname, it is working fine when there is no tank added and the user tries to add first tank but, if the user added first tank and he comes back to add one more tank and if the second tank name is blank then it is saving record without tankname.

I know if i add a return statement after the if condition it will stop the execution, but I don't know how to add a return statement in outsystems.

if tankname blank.PNG
action blank.PNG
2024-10-16 11-59-48
Nick Vandebriel

Hey Tarun,

Are you using a list to save multiple tanks? If so you should use a for each to loop over ur list and check if every list element is filled in. 

2020-07-21 19-28-50
Rajat Agrawal
Champion

Hi @Tarun Singh,

As per my understanding, tankname is not empty in second time so it will not show any empty error.

Or for more understanding please share OML.


Regards,

Rajat 

2024-10-19 11-15-19
Sazid

Please upload the OML file for a clearer understanding. I believe you may need to modify the 'if' condition to check GetTankById.List.Current.tank.Name = "". Alternatively, you can update the tank entity to set the 'Is Mandatory' property of the 'Name' field to 'True'. I've attached the OML file, which currently prevents saving an empty name. 

tank.oml
2024-10-12 12-11-20
Kerollos Adel
Champion

@Sazid hallo , 

can you add trim and check 

2024-09-27 19-05-42
Ravi Kumar Tasubilli

Hi Tarun Singh,

Maintain entity attribute mandatory so OutSystems doesn't allow empty values while saving data.

Regards,

Ravi Kumar.

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