Making a field mandotary for some users and not for others

  • 14 December 2020
  • 1 reply
  • 5 views

Badge +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

Userlevel 4
Badge +9

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")

 

Reply