I have setup a sql table (just single table) with some columns, and one column for a primary key, that has a data type of 'uniqueidentifier', and has a default value of '(newsequentialid())'.
Entering data from sql enterprise manager, I am able to create columns, and by leaving the primary key field empty, sql will auto-generate the guid when I save changes on the record.
Next I setup a new infopath form (I have tested in both 2003 and 2007), creating from database connection. It brings over all the fields fine, including the primary key. When I try to submit a new record I get an error on the primary key field "Only specific pattern allowed". This error occurs both if the primary key field is displayed on the form or not.
Checking properties of the field, in the 'details' it has the pattern:
Pattern: "\{[0-9A-F]{8,8}\-[0-9A-F]{4,4}\-[0-9A-F]{4,4}\-[0-9A-F]{4,4}\-[0-9A-F]{12,12}\}"
So, it is requiring something that looks like a GUID. This explains the error, but I was expecting that the InfoPath form would allow for no value to be collected there, and then just allow the DB to create the GUID. This is behaviour that is mentioned (but relating to Acess specifically) in this article: http://office.microsoft.com/en-us/help/HA011199501033.aspx
Is there a setting or option I am missing?
Any help with this would be greatly appreciated. I want to avoid just auto-incrementing a number in the InfoPath form to use as a unique identifier.
Cheers!