| Topic | Customizing SharePoint Form with Infopath (with test between dates) |
| Output | Infopath form |
| Step | Description |
| 1 | From your navigator, select list in the top navigation |
| 2 | In the list ribbon, select the InfoPath Icon |
| 3 | Your form is now open in Infopath |
| 4 | We want to test that the end date is greater or equal to the start date |
| 5 | First we add a valition rule the start date (not an empty field) |
| 6 | Then we do the same for the End Date (not an empty field) |
| 7 | So with both field not empty, we can add a rule that will test if End Date is greater than the Start Date |
| 7a | Using the "Expression" test |
| 7b | With the following expression :number(concat(substring(../my:End_Date, 1, 4), substring(../my:End_Date, 6, 2), substring(../my:End_Date, 9, 2))) - number(concat(substring(../my:Start_Date, 1, 4), substring(../my:Start_Date, 6, 2), substring(../my:Start_Date, 9, 2))) < 0 |
| 8 | Publish your form |
| 9 | Now you can test your form in SharePoint, if you don't respect the rules, you will not be able to publish it Bad fields are in read : and when you pass your mouse over it, you've got information about the error Now you have an edit form with controls prior to posting. |








No comments:
Post a Comment