attachments custom validation


Badge +4

I have need for very custom validation on an attachment field.

We have a series of cascading drop down menus that make the attachment field visible based on the selections. When the conditions that make the attachments visible I want to require an attachment. When the attachments are not visible, I don't want attachments to be required.

Anyone have a good way to go about setting this up? I don't see any way to do this with any of the out of the box functions and validation doesn't seem to work with rules either. I put a real simple condition like "IsEmptyOrNull" in the conditional validation field, and if I open the form initially then click save that validation kicks off, invalidates the form and puts my custom error message up, but the moment I select one of the cascading drop down options, the form "refreshes" and when I try to save the form, the attachment validation passes (even though I have not attached anything).


40 replies

Userlevel 6
Badge +15

Hey Tyler Walton‌ - 

Are you upgraded all the way? We have had this functionality since around March, I believe -- On-Prem & in Mobile, functionality confirmed & in production.


Cheers,

r.

Userlevel 5
Badge +14

Rhia Wieclawek, When I was writing the code it was not supposed attachment control will ever be usable within repeating section. so it was not written to consider this at all.

... and I haven't investigated (yet) what would need to be changed to make it working.

but looking on how selectors are applied within the code it cannot work for multiple attachment  controls with the same class.

Badge +4

Oh, no we are several versions out of date. We are presently on 2.3.2.3. Our site has to go through an extensive testing phase to update the software, and half the time we go to fix one issue that's addressed in the latest version only to update to the worst buggiest version ever. That happened this past time when we were forced to upgrade to 2.3.2.0 and they found that version killed the sharepoint timer jobs and it took them months to figure it out. All the while they blamed our servers and our network for the problem, then they finally realized it was nintex that broke the jobs. That's happened to us 3 times now with nintex. We tend not to update to the latest version unless we absolutely have to. My bet is if we weren't so dug in like a tick to nintex workflows and forms, we'd drop the whole software package to begin with.

Their testing and debugging is very lacking. Their support team is ok though, its just getting their engineers on board when we find a system breaking bug that we have issue with. Right now we're trying to figure out why lazy approvals occasionally just don't process. SharePoint processes the response into the workflow task and the approval comments get populated properly but then it just never gets dumped into the workflowprogress table in SQL. We go and look and there's huge gaps in the table and the ordering of items is all out of wack and the whole workflow just hangs and never continues. We've been fighting them on this issue for 7 months now and they have no idea whats causing it because its entirely random. We know it has something to do with how the code processes the SQL transactions, and being able to reach the database to write them into the tables, but once they're in there the whole system chokes on it and does nothing with the response. 99.9% of the time it works fine, but then .1% of the time it just stops for several hours and won't do anything and nobody knows why. We know its an issue with nintex and i'm pretty sure their engineers know it too but they don't know what the particulars are that cause it. Reason we know that is because the engineers have been stalling us with BS tests for the past 2 months. The worse problem is there's no way to go back to a previous more stable version when we update so we have to update and then sit on a broken version for several months before they fix our issues. In the meantime we have our dev and production environments out of sync during that time frame.

Oh and don't get me started on how their drop down lists can't get simple "distinct" values and filter out duplicate values. We've been waiting on that for almost 2 years now...

Userlevel 6
Badge +15

Haha, yeah - I actually wrote a blog on how I get around that one. (Filtering unique values - but - mostly focused on using 1 list for cascading lookups.) 

A 1-List Approach to Cascading Look-ups 

I'm feeling a similar way right now. I love Nintex, I love the people, but I - and my clients - are getting frustrated at seeing high, high voted things in User Voice being held there and not commented on for over 2 years. A really big one is O365 parity, overall. And Mobile capabilities. 

And, yes, Support will stall you as long as they can. We definitely need a more tiered support - we get the "are you plugged in, is your power on, is your mouse disconnected" type questions for 2 weeks before we get much.

I know they're going through a changing phase right now so I'm trying to be patient but it's getting hard -- a lot of the people I've depended on and built relationships with have left with the investor change. 

Userlevel 6
Badge +15

Thanks Marian Hatala‌ -- I appreciate your response. That's kind of what I suspected. Trying to find a way around it. Arrrgh.

You seriously need a tip jar happy.png 

Badge +4

1 or 2 list lookups for cascading drop downs are fine for static data, but we have dynamically changing systems and those lists would have to be updated hourly or even minutely if things really get into a frenzy with what I need.

I see what you did on that post and it works (Except the orange in Tier 3 is noted as unique twice, not sure if that's intentionally done or not) but it would be hard for me to use something like that since the tier 1 data could change, and how would the system know it's unique? I'd have to build a whole workflow to identify the first unique value and flag it in each tier... I suppose it might work but seems like a lot of work to setup all that stuff when I can just use infopath to create a distinct SQL filter and not use a nintex forms at all.

The only reason we went to nintex is because microsoft said infopath (or infopath support at least) was going away, which is why I have to use the stupid nintex forms at all. Why can't they simply put the stupid distinct in their DDL control? How hard is this? transition or not, its been upvoted so many times and yet its still not in the form control... I think they do it on purpose so that you have to buy their enterprise level stuff that can do sql queries from the form directly. Whats worse is we've had nintex before there ever was an enterprise or standard level. You'd think we'd be grandfathered into the enterprise software, but no, we're stuck down in the "standard" version. I dunno how our management team got shafted on that deal...

Userlevel 5
Badge +14

haha, a single €/$ for each post and I might have had enough to end up with nintex happy.pnghappy.pnghappy.png

Badge +4

Didn't know you had a couple of hundred million posts on here. Congrats!

Badge +9

Thanks for your comment Tyler Walton‌. Your explanation of some of the issues you have encountered in your environment has definitely opened some eyes on a lot of the things we've been encountering with our clients..  

Badge +7

Tyler Walton here's a really simple code option for removing duplicates from lookups automatically:

Userlevel 6
Badge +15

This is awesome, as long as you have no intention of using Mobile or Responsive.

Badge +4

Not sure but this link can give you some idea.  

Badge +9

@emha 

 

Is it possible to set a calculated value (connected to a column) to "Yes" if the count is > 0?  I've tried various methods but it won't display, such as

 

function GetNumberOfAttachments(attCtrlClassName) {

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

if (GetNumberOfAttachments("nf-form-input") > 0) {
NWF$('#' + AttachmentBoolean).val("Yes");
NWF$('#' + AttachmentBoolean).trigger('focusout');
}

 

Userlevel 5
Badge +14

pure technically, yes it's possible.

 

 

but the problem is how to fire calculated value control recalculation based on attachement changes....

one would need to make the formula dependent on attachement control. but attachement control is not listed among named controls, so you cannot reference it directly.

furthermore, due to it's complexity, attachement control do not fire any 'change' event that you could write custom handler for.

 

so one would need to make some custom/manual trigger to force recalculation. eg. textbox change, yes/no checkbox state change, etc.

if that' suitable for you, then I think it could work.

 

Badge +3

Hi all,

I have a form (Nintex Forms 2010 - 1.12.2.20) that has 8 attachment fields, each of them, depending on the stage of completion, must contain a file. I used the solution available on this site and put in setting the code:

function GetNumberOfAttachments()

{

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

}

NWF$( document ).ready(function($){

//alert(1);

}); 

 

Then in each of the attachment fields, I put in CSS Class: AttachmentControlClass1, ..... AttachmentControlClass8

 

For each of the attachment fields I made one rule:

(T1!=0)&&(GetNumberOfAttachments("AttachmentControlClass1")<1) ......

(T8!=0)&&(GetNumberOfAttachments("AttachmentControlClass8")<1)

Where T are fields Yes No

 

When I mark the T fields and submit, there are criticism in all attachment fields, but if I put one attachment in the first attachment field and submit, there is no more criticism in the other fields.

Please let me know if I am making a mistake or if is not possible validate multiple attachment fields,

 

Regards

Reply