Stop the Submit if the form is open as read only - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Stop the Submit if the form is open as read only

Last post 08-24-2009 11:12 AM by Hilary Stoupa. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-20-2009 12:21 PM

    • Danielle
    • Not Ranked
      Female
    • Joined on 02-17-2009
    • North Carolina
    • Posts 12

    Stop the Submit if the form is open as read only

    Hi friends,

     I have the below code that runs for my submit that is running off of a button.  Does anyone know how to (what to) put to stop this from running and give an error message if the form is open as read only?  I am getting row update errors if someone trys to submit it as read only, there ends up being a conflict.

     function CTRL2114_7::OnClick(eventObj)

    { try

    { XDocument.QueryAdapter.Timeout=240;

    XDocument.QueryAdapter.Submit();

    XDocument.DataAdapters["MainConnection"]

    XDocument.DataAdapters["Submit"] .Submit();

    XDocument.UI.Alert("Document submitted successfully.");

    eventObj.ReturnStatus = true;

    XDocument.SetDirty(false);

    XDocument.View.Window.Close(true); }

     catch(ex)

    { XDocument.UI.Alert(ex.description);

    eventObj.ReturnStatus = false; }

    }

    Danielle
  • 08-24-2009 11:12 AM In reply to

    Re: Stop the Submit if the form is open as read only

    You can find out if it is read only using XDocument.IsReadOnly. See this MSDN entry for more.

    Hilary Stoupa

Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.