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.
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.
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
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.
@Sazid hallo ,
can you add trim and check
Hi Tarun Singh,
Maintain entity attribute mandatory so OutSystems doesn't allow empty values while saving data.
Ravi Kumar.