Skip to main content
Nintex Community Menu Bar

Making a field mandotary for some users and not for others

  • December 14, 2020
  • 1 reply
  • 9 views

Forum|alt.badge.img+5

Afternoon

 

I'm trying to make an attachment field in my Nintex form mandatory for a group of Line Managers and not mandatory for our IT department. Is there a way to do this? All help appreciated!

1 reply

allan
Nintex Partner
Forum|alt.badge.img+9
  • Nintex Partner
  • December 18, 2020

The only way is to define a new JavaScript function to check how many attachments are there.
Place that in the JavaScript section of your form settings.

 

function GetNumberOfAttachments(attCtrlClassName){ return NWF.FormFiller.Attachments.GetAttachedFilesCount(NWF.FormFiller.Functions.GetFillerDivObjectForControl(NWF$("#"+NWF$("." + attCtrlClassName + " .nf-attachmentsRow")[0].id)).data('controlid')) }

 

And use it in a validation rule this way :

 

GetNumberOfAttachments("CSS Class of your control") < 1 && fn-isMemberOf("Your group")