SharePoint 2010 has great possibility to implement simple InfoPath forms directly from the custom lists, without converting this lists to InfoPath Form libraries. Even this possibility has some limitations (e.g. no custom code behind form), it excellent option for simple forms, like cascaded fields or fields with filtered ranges.
InfoPath List Form can also have a “Multi-Selection List Box”, which is also default control for a form, which has lookup field from other list. In my case I’m filling this list with persons and my customer can select one or multiple persons who has specific role. This is relatively simple task: first you have to create a new Data Source from the persons list, than filter all elements by the role when presenting it into multiple selection list box control. So far so good. However, when you publish this simple form, even without any modification from your side – you will not be able to submit new list items using it. InfoPath will give you an error: “InfoPath cannot submit the form because it contains errors. Errors are marked with either a red asterisk (required fields) or a red, dashed border (invalid values)”. However, your form haven’t neither asterisks nor border. If you will look for error details, you will see “Field or group: Value Error: Only positive integers allowed”.
Reason of this error is “default value” Multiple Selection box has behind. Multiple Selection List Box is a XML repeating section. If you will look into “XML” data, you will see that new form will already have an empty element, which can’t be submitted to the list where field is required.
Solution is relatively simple – remove empty default element. To do it, under “File” menu in InfoPath, go to “Form Options” and under “Advanced” select “Edit Default values”. Navigate to your repeating element and just remove checkbox left to the Value. That’s all.