Sunday, June 5, 2011

InfoPath for the web

There are some constraints while designing InfoPath forms for the web.
First thing is that it does not support views!
If you wanna make a readonly view, then .... not possible ...
But, you can write a rule for every element by sing the username() function to see who has logged in
like
I wanted to disable a textbox when someone login, other than the administrator (the system account)
so, put a textbox on a form , in its properties window click on the fx button

Select username function as shown above and click ok for every window.
Once you have this text box, it can be used to validate every other control on the form
Suppose I have another txtbox called field2, and I need to enable it only if system logs in then,
Double click the textbox to see its properties (for IP 2010, add a new formatting rule)
then ....


In the display tab click conditional formatting to get the window shown above
Then select field1 (or whatever you called the username textbox) then select no equal to in the second and type system in the third, then check read-only.
Click ok for every window.

After publishing this form, you can only find field2 enabled when you login with the system account.

Another thing in web enabled forms is that they don’t allow a section within a section!
That’s one great feature in InfoPath, maybe you won't require it, but what if you want to hide a datepicker that is in a repeating table?
You need to use a section and put the formatting rules in there.
Like: http://www.infopathdev.com/blogs/shiraz/archive/2006/09/08/Hide-a-Date-Picker-Control.aspx
How can you show this web?
please, tell me if you know....

No comments:

Post a Comment