I am using IP2007 and SP2007.
I have a complicated form that I have managed to get deployed as Browser Enabled via Form Services.
The backend database is SQL Server using a WebService connection to send and receive data.
The webserver currently has one "open" method to return data based on the FormID - which is an AutoNumber column in SQL Server.
Perhaps I did this wrong in my WebService, but I have a new form open up with a hidden default value for the FormID as 0.
When the form is saved to the WebService, the code checks if the incoming FormID is 0, if so, it "Inserts" a new row - if not, it "updates" based on the "none 0" FormID.
This works fine... Until I have a user want to update an existing form and they open it via SharePoint.
What I guess is happening is that sharepoint stores whatever was initially submitted - which means all the ID's on the form will be 0 since that is the default value.
Those values wouldn't actually change until the data hits the database - so a new form wouldn't know what values go there in the first place.
I have tried some of the following ideas.
On the Submit button, Save the form to SQL first, Requery, then Save the form to Sharepoint.
I have tried to employ a rule that when the form is opened, it requery's the WebService connection - but without a proper ID - the form is locked up.
So the question is....
When using an autonumber (or any other PK) from SQL Server, how do I get those SQL assigned PK's updated on a from when it is opened from a SharePoint list?
Edit... What I would like to do is have a Link that opens the form and it uses the WebService to retrieve the data - instead of opening the form XML that was saved to the SharePoint list.
But how do you do this? Something like http://mysite.com/_layouts/FormServices.aspx?blahblah.... ?FormID=46 - not sure how this would work.