warrtalon:
Do you need to use code for this? It's a built-in feature with a checkbox on the Browser tab of the Form Options menu. If your form is not browser-enabled, I would think you could add a Refresh rule to your Submit "button" that refreshes any or all data connections before the submit action itself.
I'm using IP 2003 and I didn't see that option available. There will already be a submit button at the top of the form where it submits via email data connection. Since it was a requirement to use the Data Connection, having two submit buttons would confuse the user.
I think I figured it out but there's still a problem:
1) Instead of submitting to email, submit via code.
2) Use the following code:
XDocument.DOM.selectSingleNode("my:....").text = XDocument.Errors.Count;
XDocument.DataAdapters["ExtranetSubmit"].Submit();
This seems to work fine. But if I cancel the submit, I get an error back stating it was cancelled. Is there an error handle I can place in where if they cancel, it will just accept the cancel?
Don't grow old regretting the things you didn't do.