Some thoughts on validations for SAP Interactive Forms
I often get asked where validations for Interactive Forms should be implemented. There is the option to do it locally in the form using the possibilities provided by the Interactive Form (e.g. patterns or scripting) or it can be done on the back-end after the data is submitted back from the form. When you have to decide where to implement your validations you should also take a look at your scenario. If it’s an offline scenario you cannot do a server roundtrip for validations. Hence, validations have to be implemented twice: In the form and on the back-end. The recommendation here is to implement only validations that ensure data accuracy. More complex validations like verifying business partners should reside in the back-end. In other words do not put too much business logic into the form itself and error handling takes place on the back-end.
For offline scenarios a PDF has to contain everything you need for validations meaning the additional data (e.g. lists of allowed values) used for validating input is part of the PDF form and thus increasing it’s size. For online scenarios it’s easier since you can do a server roundtrip so you do not have to implement validations twice and include additional data. You only want to implement it on the back-end.
For defining validation patterns it is necessary to know the pattern language. I strongly recommend taking a look at the Picture Clause Specification that is contained in Part 3 of the XFA specification. By the way if you have not seen my blog about “Useful documentation for developing Interactive Forms” I recommend looking at it 😉
In the picture clause specification you can find a pretty good description of patterns. Patterns are used in various ways for fields. You can define a display pattern, an edit pattern, a validation and a data pattern. A display pattern is used to format a data value when it is displayed on the screen. The edit pattern is used when a data value is edited. Validation patterns are used if a data value has to be validated after entry. And with the data pattern you can define in which format a data value is stored in the XML data.
You should add validations to your form wherever possible. Especially for offline scenarios additional “intelligence” greatly improves usability and acceptance. One thing that always should be done is to re-validate on the back-end to make sure no one manipulated the data.
Would like to see a blog on this.
The security story behind Web Service calls is not the best. If you create a Web Service data connection in Designer there is no authentication at all. If you use the SOAP object and scripting you can at least have a user name/password authentication.
Please suggest some alternatives.
Thanks for your reply.
To suggest an alternative depends on your scenario (what you are using the Web Service for). For example if the Web Service is used to submit data I would suggest using an email to submit data. If your have an online scneario you could think about using Web Dynpro.
If the data is submitted through e-mail, do you mean by manual intervention (through an administrator for updation) or triggering an event in SAP(workflow).
If latter is the case, how is the auhentication done?. The former is not favoured due to the manual intervention.
Thanks for your prompt reply.
Can't i do some thing with digital signatures for this web service scenario. I believe this is possible.
Dig Sigs don't help you in a Web Service scenario. They are part of the PDF form.
Thanks for publishing this wonderful blog. Please keep bringing the good stuff for us.
If form based validation is performed, and if wrong data is entered, a Message Box appears showing the Validation Message, but after that the false value remains there in the field itself, its not cleared.
It would be better, if it the field is automaticaly cleared after displaying the message.
Is there a way to do this?
What I could think of is implmenting you own validation in the validate event. Then you could clear the field.