1

I have a form with two views, one view has all fields like title, date, subject, country, Yes/No and state. The other view only has date and Yes/No (a checkbox).

On the first view all fields are required but if the user selects the second view only tilte and date should be required. My issue is that if I add required rules on the first form the fields that are not present on the second view still are required. I tried to add a condition like required if state is present but on the second view where it is not present it is still required.

Any ideas?

Thanks in advance.

  • 1
    Can you re-phrase your question? It is currently not comprehensible, First, you tell about views of the same form, then about separate "the first form". Does the phrase "if the user selects the second view only tilte and date should be required" mean that required Title should be filled on another separate , first, view whaen a user fills the second view? Then, you write contradicting phrases about "only tilte and date" required and further theat "state" is required when on 2nd view – Gennady Vanin Геннадий Ванин Jul 8 '12 at 15:03
1

Check the field properties on InfoPath2010(and also on SharePointDesigner2010). On the properties, AllowNullValues must be unchecked. After that, you can use rules to set field's requirements.

0

With form services you can't use validation rules.

The approach I've used in the past is have a defined "Null" value. So if you don't need a "Subject" value you still populated it with something like "NA". In your form you use rules to set the content. I prefer to keep them in the Submit section prior to save, so I would check if Subject has a value and if not I set it to "NA". So now you can set the fields as required on the form and regardless of view they have to fill in only the fields you show, and the form logic fills in the rest.

Now, if you don't like seeing these "NA" or "999", etc values in your list, you can edit the list view in SharePoint Designer and add formatting rules that can remove rendering of values if they equal whatever it is you chose.

  • You can absolutely use validation rules with form services. Anecdotally, I have created an entire invoice payment system using InfoPath forms services which have conditional validation and it works. I'm not sure where I can grab some documentation to back this up. – panic Aug 3 '17 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.