Did not expect an argument to be undefined

Hi all, I’m creating a form validation system in a separate module for one of my application. Each field has it’s own OnLeaveNanoflow which in turn calls the ValidateFieldNanoflow and sets the validationMessage variable by using getCaption(ENUM_ValidationMessages). Just while setting the value the flow breaks and I get this error “Did not expect argument to be undefined”. But when I’m hardcoding the value as a string it’s working fine and validation message is getting displayed. Can anyone tell me what is exactly causing this issue? I really need some help to figure this out. Thank you.
2 answers

Hi Bidit,


if you want to use validation message from ENUM. Then assign that ENUM to any one of your attribute. 


Consider your attribute is ValidationMessage, Assign ENUM to this attribute.


On some condition you might be updating the ValidationMessage attribute using ENUM value.


For example

Consider your ENUM has following messages:


Name is required.

Mobile Number is required.


In your nanoflow, you see user not filled the name field. At that time you want to show validation message : Name is required.


In that case you can update the ValidationMessage attribute with ENUM value


$ValidationMessage = ENUM_ValidationMessages.Name is required.




First Can you check if you proper access to the attribute also check

if ($currentObject/Enum != empty) 
then getCaption(ENUM.ABC)
else '’