Hi experts, i'm a beginner in Nintex and need help here..
I wanted to have 2 attachment controls with following validation respectively, somehow I'm unable to get the correct result. Not sure if anyone can help me out on this..
Expected result:
Validation check should be according to the individual attachment control. When Equipment type = FOAK,
both attachment must attach at least 1 document respectively.
e.g:
1st attachment control = 1, 2nd attachment control = 1 --> PASS
1st attachment control = 0, 2nd attachment control = 0 --> FAIL
1st attachment control = 1, 2nd attachment control = 0 --> FAIL
1st attachment control = 0, 2nd attachment control = 1 --> FAIL
Actual result:
1st attachment running fine. 2nd attachment is NOT. Validation pass as long as there is an attachment in the form.
e.g.
1st attachment control = 1, 2nd attachment control = 1 --> PASS
1st attachment control = 0, 2nd attachment control = 0 --> FAIL
1st attachment control = 1, 2nd attachment control = 0 --> PASS
1st attachment control = 0, 2nd attachment control = 1 --> FAIL
Following are how i configured in the control setting + javascript
1) 1st attachment control (Attachment2)
- minimum attachment = 1
- control setting:
2) 2nd attachment control (Attachment_1)
- minimum attachment = 1 if "Equipment Type" = FOAK
- control setting for attachment:
- control setting for Equipment Type:
hence, i use JavaScript as below for 2nd attachment control as it can only be done using javascript.
Thank you so much..~
Can you not use a validation rule? Have the rule configured such that the Attachment 2 control is invalid if isNullOrEmpty{Self} && Equipment Type == "FOAK" ?
I removed the validation rule but it still does not work.
I have tried isNullOrEmpty{Self} && Equipment Type == "FOAK", unfortunately, it does not work that way.
I created 2 attachments where label name are Attachment2 and Attachment_1 respectively. But, in "Name Controls" and "Items Properties" I cannot find any of the fields mentioned, only "Attachment" shown in Item Properties where it only carry the value true or false. I believe it is an default attachment field for all.
The only way I found is to use JavaScript for attachment validation. Somehow, it does not solve my issue 100%. Not sure if you have any better idea for this..
have a look on these examples https://community.nintex.com/search.jspa?q=GetNumberOfAttachments
if you configure different class to every attachment control, you should be able to validate them independently.