Thanks for your reply!
We tried what you suggested but it's not quite working. We have
created a data connection for submit that submits the form to a
SharePoint form library then closes the form. We have two buttons that
make use of this data connection.
The first button, called "Submit", has "Submit" as the action in the
button properties and it works properly (i.e. it submits then closes
the form).
The second button, called "Approve", has "Rules and Custom Code" as the
action. When the user clicks on the "Approve" button, we would like to
set the "state" field of the form then run the submit as normal (i.e.
submit and close). For our custom code we have:
function BTN_APPROVE::OnClick(eventObj)
{
var clicked = XDocument.UI.Confirm("Are you sure you want to Approve
this form?", 4);
if(clicked == 6)
{
var stateNode =
XDocument.DOM.selectSingleNode("/my:myFields/my:state");
stateNode.text = "Approved";
XDocument.Submit();
}
}
Everything works EXCEPT it doesn't close the form. Any suggestions?
Thanks again,
Tracy
Scott L. Heim [MSFT] - 17 May 2005 21:03 GMT
Hi Tracy,
If you want to just close the current InfoPath document, you can use the
following:
Application.XDocuments.Close(0);
However, if you want to close InfoPath entirely, use:
Application.Quit(false);
I hope this helps!
Best Regards,
Scott L. Heim
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights