Hi,
In the case where I have a forms with draft, I need to perform differents actions according to the click on draft or submit button.
In my case, I have various type of fields (text, multi line, dropdown list ...) with rules on it.
On the bottom of the form, I have repeating section with different type of field and rules on it.
So my goal is :
- When I click on "draft button", no rules have been applied.
- When I click on "submit button", all rules have been applied.
One rule to do this : I don't want to use Javascript (or the least possible)
If someone have a solution, thanks in advance.
Théo
Solved! Go to Solution.
I get back to you with a solution =) !
Requirement on your form :
4 buttons
2 Technical textbox
Javascript but really little for instance (four lines max.)
Explanation :
I don't want to explain how to set up Javascript into a Nintex forms because I think you have lots of tutorial on the forum so I start directly with the command.
In your javascript, add the previous function that you have on the button so here, it's like :
function IsDraft(){
NWF$(".draftControl").val(0);
NWF$(".hiddenDraft").click();
}
function IsNotDraft (){
NWF$(".draftControl").val(1);
NWF$(".hiddenSubmit").click();
}
So, now that all elements are set up and OK, we will set up some rules.
Actually, I place my rules on control which are in repeating section like the following :
Add rule type validation and adapt the following rule. Replace bold and underligned word by your own rules. Don't forget to re-import your own named control.
I don't have time to explain more for now but if you need more detail, don't hesitate to publish your questions on that post.
If(equals(IsNotDraft,1),or(isNullOrEmpty({Self}),equals({Self},"--")),equals(ForcedValidation,1))
Théo
Hi Theo
This seems to apply to fields that are not required sharepoint columns. I'm guessing there is not a way to get the Draft to ignore required sharepoint fields? And so all validation must be set in the form and not on the list. I have many required sharpoint columns that I'd like to ignore with one rule in the form.
Thanks
Joanne
Thanks for this solution Theo, it may require me to do some additional work, but this works perfectly.
Hi Joanne,
Sorry for the delay. Yes, indeed I forget to check this parameter.
I haven't access to my forms anymore but if I supposed yes that you can't by-pass sharepoint fields parameter.
One way to know, basic test on one field just to be sure.
BR
Théo