cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Form validation rules vs Draft save

Hi All,

We'd like to create a "Draft save" functionality. It was discussed multiple times in this forum, so that part is clear.

My issue is, that my form has multiple validation rules and I'd like to ignore them when I want a draft save. Mandatory fileds are obvious, but the rules are tricky.

The button's "causes validation" doesn't work like this, only the JS buttons...

Any idea? JS which blocks the rules?

Thanks in advance,

Robert

Tags (1)
0 Kudos
Reply
2 Replies
Workflow Hero

Re: Form validation rules vs Draft save

Asim MahmoodAsim Mahmood​ haven't you done something like this?

Accept as Solution Reply
Not applicable

Re: Form validation rules vs Draft save

I don’t know if there is a better way, but to achieve this I used a custom validation function as the rules caused me issues.

• I added a multiline text field to my form.

• created separate save and submit buttons

• created a status column.

• I then created a custom validation function in JavaScript and added it to all the mandatory fields on my form. (you also need to give the fields JavaScript variable names so that you can check their value in your function).

To make this work, the JavaScript function

• Must always allow a submit (set arguments.IsValid = true; ​in the JavaScript) so that the form can be saved.

• Must refresh/update the multiline field with the names of fields that are still required everytime it runs.

• Must only enable the submit button when all the necessary criteria is met.

• Only needs to run all code (depending on complexity) when status = draft

The submit button changes the status to submitted.

Accept as Solution Reply