Problem with XDocument.SetDirty(true) - InfoPath Dev
in

InfoPath Dev

Problem with XDocument.SetDirty(true)

Last post 01-09-2007 04:54 PM by Greg Collins. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 01-03-2007 04:34 AM

    • zaphi
    • Top 150 Contributor
    • Joined on 01-09-2006
    • Switzerland
    • Posts 82

    Problem with XDocument.SetDirty(true)

    Hi,
    To keep sure, that the user save every change in a form, also by leaving with the red close-button, I have put the following instruction in the OnLoad event handler (JScript):

    XDocument.SetDirty(true);

    It works with one form template, but not in another one. Does anybody understand the problem? For the both templates, the forms are saved in SharePoint.

    Thanks for your help.

    Philippe
    Infopath 2007/SP2
  • 01-03-2007 05:18 AM In reply to

    Re: Problem with XDocument.SetDirty(true)

    Hi,

    I think we have to call XDocument.SetDirty method only in OnSubmitRequest and OnSaveRequest and try to call this methods only instead of Onload event handler and it will work for you

    Hope this helps!

    Hope this helps!
    Shilpa
    INFOPATHDEV India
  • 01-04-2007 12:40 AM In reply to

    • zaphi
    • Top 150 Contributor
    • Joined on 01-09-2006
    • Switzerland
    • Posts 82

    Re: Problem with XDocument.SetDirty(true)

    Hi Shilpa,
    Thanks for your answer.

    You're right. SetDirty is no use in the Onload event handler. I have searched and realized why it was not working for one of my form template. "Save and Save As" was not selected in the form options.

    What I will do now is setting "Save and Save As" in the form options and deactivate the Save menu and button (with CommandBars object) to avoid, that user save the form in another location.

    I have realized that signatures are not considered as modification before closing, and the form could be not saved. I've put the SetDirty function in the OnSign event handler and it works.

    I don't use the OnSaveRequest because I need the Save() ans SaveAs() functions. These functions seem not to be working with this event handler.

    Best regards.
    Philippe



    Infopath 2007/SP2
  • 01-04-2007 04:17 PM In reply to

    Re: Problem with XDocument.SetDirty(true)

    So is your problem solved now, or is there something else that still isn't working right with this?
  • 01-09-2007 02:21 AM In reply to

    • zaphi
    • Top 150 Contributor
    • Joined on 01-09-2006
    • Switzerland
    • Posts 82

    Re: Problem with XDocument.SetDirty(true)

    Hi Greg,
    I have still a little issue in relation with the deactivation of Save-Menu and button. I have send a new post for it. Seehttp://infopathdev.com/forums/topic.asp?TOPIC_ID=4058

    So you can consider, that this problem is solved.

    By the way, isn't it possible to set the status of the post to "solved" or something like that? It would simplify the search inside the forum.
    Best regards.
    Philippe
    Infopath 2007/SP2
  • 01-09-2007 04:54 PM In reply to

    Re: Problem with XDocument.SetDirty(true)

    Sorry-no way using this forum software to do that. We can lock the post, but others sometimes have similar issues and use the same post to continue the conversation.
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.