Input given as empty for a mandatory field

Input given as empty for a mandatory field

  

Hi 

I'm using a sever action which has validation conditions for all mandatory fields to save a record. It is working fine in that module and now I'm trying to use that server action in a screen action of another application. I have assigned input data through an excel sheet which contains valid inputs and empty inputs also. But the record is getting created even if the field is given as empty. It is taking as ("   ") and the record is getting created.  Please help me out.

Thanks in advance


Hi Manjusha,


Have you tried using the trim() function in your validations? 

This basically removes the "blank" spaces in those fields.


Best regards,

Davide Résio

Davide Résio wrote:

Hi Manjusha,


Have you tried using the trim() function in your validations? 

This basically removes the "blank" spaces in those fields.


Best regards,

Davide Résio


Thank you for your response.

I have tried with trim also but still it's the same.


Manjusha Kavitam wrote:

Davide Résio wrote:

Hi Manjusha,


Have you tried using the trim() function in your validations? 

This basically removes the "blank" spaces in those fields.


Best regards,

Davide Résio


Thank you for your response.

I have tried with trim also but still it's the same.


Would it be ok for you to provide a sample .oml with an example?


HI Majusha,

I'm not sure I follow. There are some checks there, but none of them match what you say. Also, did you debug at all? If you debug you can follow what happens.

Hi Majusha

I'm guessing you're referring to this aggregate:


It looks like the list is not returning empty. You must have records with the middle name as "   " already in the database, and that is why it is being created. I would suggest two things of that is indeed the case:

  • Removing any unwanted records from the database. It can be done with a bulk delete if you have clear delete criteria such as MiddleName = "  "
  • Adding a filter on the Aggregate Person.MiddleName <> "  "

This should return the Aggregate as empty, and show you the validation feedback.


Hope this helps! 

  - CLSJ

Kilian Hekhuis wrote:

HI Majusha,

I'm not sure I follow. There are some checks there, but none of them match what you say. Also, did you debug at all? If you debug you can follow what happens.


Yeah actually I was doing BDD testing for another application. So, I just did a sample application and have uploaded it for sample, and I know its not exact. I have debugged and checked the actual application then only I got to know that it is taking an empty string like "    ".