Validation and views

K

keith_bodie

I am having a problem trying to create a form which has conditional
validation based on what the current view is. Take the following
example of a vacation request form:

Requestor View - 2 fields

Employee Name - required
Dates out of office - required

Manager View - 3 fields

Employee Name - populated with requestors information and disabled
Dates out of office - populated with requestors information and
disabled
Status (approved, rejected) - required

When the requestor attempts to fill in their view, upon submission
InfoPath complains because the status data field is blank. Any
suggestions?

We do not want to resort to using code as one of our goals of using
InfoPath is to have our business analysts create these forms themselves
as opposed to programmers.
 
F

Franck Dauché

Hi Keith,

In your Status drop-down, even if the top value Display Name is blank. The
Value stored in your node should be "N/A" for example. This way, the node
will never be blank.

Hope that it helps.

Franck Dauché
 
K

keith_bodie

Unless I misunderstood you, I don't think that would solve the problem.
While this would prevent the validation error from occurring for the
requestor, it would allow the manager to not choose an approval status.
This obviously is not valid business logic.
 
F

Franck Dauché

Of course, you need to build that business logic. If a manager is on his/her
view. You need to add a rule in the submit button to prevent that manager
from submitting the form in case the value stored in the approval node is
"N/A". You can also do this using code behind (I would go that route as you
have more control over the logic).

Regards,

Franck Dauché
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top