Friday, August 18, 2006 12:35 PM
This can't be right....can it?...
1. When concatenating fields using rules you cannot put in newlines, you can only do this through code
2. You cannot have both code on a button click event and also have a "close the form" rule on the same button, this in IP client stops the code from executing; but in forms server it makes the web page get stuck and displays a msg saying "Form Closed" and at the same time a looping message saying "Form Loading".... weird...
3. It is possible to trigger a submit from code, but not a save or close form
4. You can clear the errors buffer and therefore remove all validation errors from a form through code
Based on the above findings the only (watch out this gets nasty)....way that I can see to implement a custom submit button which ignores validation is as follows.....
1. Create your button that executes your code and clears the errors on a view
2. Edit the code-behind on this button such that it switches to another view eg: one called say "Closure"
3. On this new view have a nice big button called "Close me now" (with a rule to close the form), and the user clicks this to close the form.
This is an extremely nasty and non-user friendly solution, if anyone has any cunning ideas on how to make a nice user friendly solution it would be much appreciated.
Surely Infopath is better than this???
For now I have made my close button say "Return to library" as this seems slightly better. The user also gets told that the form has been sent on or placed on hold depending which button they pressed on the previous view.
One useful tip from this...
I was copying and pasting my buttons all over my 16 views and placing them top and bottom of the form. If you do this on one form top and bottom, you only need to create code for the 2 alternatives. This is because the names of buttons only have to be unique within a view not within the whole form, and therefore you can call the same code from buttons in different views that have the same name. handy.