cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
anderj39
Nintex Newbie

How can I make attachments required if a particular box is checked?

Jump to solution

I have very little JS knowledge.  I can follow some, but am lost with most.  So I've read a similar question, only rather than a checkbox, the example shows attachments being required based on the value in a dropdown list.

If the "Are there existing Map(s)?" box is checked, I need at least one attachment to be required.  Please help! Thanks!

Labels: (1)
0 Kudos
Reply
18 Replies
mapeacock
Nintex Newbie

Re: How can I make attachments required if a particular box is checked?

Jump to solution

Hi,

Have you seen this post?

number of attachments based on calculated field value  

I would add the GetNumberOfAttachments function to the forms Custom Javascript section, change the CSS Class as shown on the Attachments control and then add a validation rule that checks if the "Existing Maps" checkbox is checked or not in combination with the outcome of the GetNumberOfAttachments function, alerting as appropriate.

Cheers,

Mark

0 Kudos
Reply
anderj39
Nintex Newbie

Re: How can I make attachments required if a particular box is checked?

Jump to solution

I saw that post, however, I am still completely lost with how to factor in my titles and the checkbox. My JS knowledge is very minimal.

0 Kudos
Reply
Automation Master
Automation Master

Re: How can I make attachments required if a particular box is checked?

Jump to solution

for yes/no checkbox validation formula should simply be

cbMapsExists && GetNumberOfAttachments("AttachmentControlClass") < 1

cbMapsExists is Named Control reference for the checkbox

AttachmentControlClass is CSS class assigned to attachment control

0 Kudos
Reply
anderj39
Nintex Newbie

Re: How can I make attachments required if a particular box is checked?

Jump to solution

Thank you for the reply!

I set the CSS name on the Attachments as AttachmentControlClass.  And I have the checkbox name as "ArethereexistinsMaps."  Below is the validation formula I added to the Yes/No checkbox.

When I check the box and submit the form with no attachments, I do not get an error.  I am still able to submit without attachments.

Anything I am missing?

0 Kudos
Reply
Automation Master
Automation Master

Re: How can I make attachments required if a particular box is checked?

Jump to solution

as mentioned above, you have to add checkbox to the formula as Named Control reference, not just simple type it in

it has to get red in formula builder.

0 Kudos
Reply
anderj39
Nintex Newbie

Re: How can I make attachments required if a particular box is checked?

Jump to solution

I do not see a Named Controls tab...

Am I inputing this formula in the wrong area?  I have put this under the validation on the yes/no checkbox...

0 Kudos
Reply
Automation Master
Automation Master

Re: How can I make attachments required if a particular box is checked?

Jump to solution

you have to create validation rule assigned to (the best) attachment control

0 Kudos
Reply
anderj39
Nintex Newbie

Re: How can I make attachments required if a particular box is checked?

Jump to solution

Thank you for your continued help and patience...

I think I have it set now.  However, it's still allowing me to submit the form without an attachment.  No error message.  Anything else I need to do?  Does it not automatically activate?

0 Kudos
Reply
Automation Master
Automation Master

Re: How can I make attachments required if a particular box is checked?

Jump to solution

- can you post configuration of "ArethereexistinsMaps" control

- can you post configuration of attachment control?

- have you added script for GetNumberOfAttacments() function into from settins >> Custom javascript?

- open developer console (F12) and run/reload the from. check the developer console whether there are not reported any errors

0 Kudos
Reply