Help with custom Save/Submit options for browser based forms? - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Help with custom Save/Submit options for browser based forms?

Last post 08-16-2007 08:16 AM by Shiraz Cupala. 11 replies.
Page 1 of 1 (12 items)
Sort Posts: Previous Next
  • 05-07-2007 07:08 AM

    • scallin
    • Not Ranked
    • Joined on 05-04-2007
    • Canada
    • Posts 2

    Help with custom Save/Submit options for browser based forms?

    I'm developing a browser based form that will have multiple people editing it before it's finalized.  I also need to have custom code run when the form is submitted/saved to the SharePoint library.

    From what I understand, I can only write custom submit code - not save code - for a browser enabled form.  The problem I'm having is when another user opens the form makes changes and submits the form back to SharePoint, it creates a second record instead of updating the original form.

    So my question is, how can I design the form such that I can have custom code run during the submit, and have additional edits update the existing form instead of creating a new one?

    Thanks in advance...

  • 05-07-2007 08:42 AM In reply to

    Re: Help with custom Save/Submit options for browser based forms?

    I have not had much experience with SP2007 and browser based forms yet but I do know on SharePoint, at least with 2003, in the setup of the document library there was a place to insert custom code that would utilize a built-in trigger when something was saved there.  In was in the same location as linking a document library to a exchange public folder.  You would have to research this but this was one point where you could do some scripting on the SharePoint side when a document was submitted. Not sure if this would help but wanted to throw that out.
    Filed under:
  • 05-07-2007 10:11 AM In reply to

    • scallin
    • Not Ranked
    • Joined on 05-04-2007
    • Canada
    • Posts 2

    Re: Help with custom Save/Submit options for browser based forms?

    Thanks Clay,

    I'll probably end up using the library events for emailing or security but I was hoping to use the submit event since it saves and closes the form at the same time - or it can cancel the submit entirely.  Not sure if I could get the same result from the library events...

    I've got a working solution now by making the following changes:
    - Stored the filename in a hidden field so it remains the same for each submit.
    - Modified the data connection file so that overwrites are allowed.

    It looks like SharePoint is smart enough to recognize that it's the same file (since it has the same filename) and updates the existing one.  So when I look at the items properties it has a creation date/time that's hours earlier than the latest save.

    So it looks like it will work...I guess the only concern is 2 users creating a new form at the exact same second and the last one to save wins.

  • 05-11-2007 12:02 AM In reply to

    Re: Help with custom Save/Submit options for browser based forms?

    Well, I had the sane problem :) So my solution was:

    1. I created Submit DataConnection to Sharepoint Library.

    2. Then I created custom code for my submit button.

    3. Write something like this:

    public void btnSubmit_Clicked(object sender, ClickedEventArgs e)

    {

    //       My code here ....

           

             DataConnections["myDataConnectionName"].Execute();

             DataConnections["myDataConnectionName"].Execute();

    }

    Hope it helps ...

    void btnSubmit_Clicked(object sender, ClickedEventArgs e)

    {

    //       My code here ....

           

             DataConnections["myDataConnectionName"].Execute();

             DataConnections["myDataConnectionName"].Execute();

    }

    Hope it helps ...

    Best regards,
    Alexander Ekzarov
    Kyiv, Ukraine
    silverlightnet.blogspot.com
  • 05-11-2007 12:05 AM In reply to

    Re: Help with custom Save/Submit options for browser based forms?

     

    I`m sorry for misprints.... 

    public void btnSubmit_Clicked(object sender, ClickedEventArgs e)

    {

    //       My code here ....

           

             DataConnections["myDataConnectionName"].Execute();

             DataConnections["myDataConnectionName"].Execute();

     

             DataConnections["myDataConnectionName"].Execute();

    }

    {

    //       My code here ....

           

             DataConnections["myDataConnectionName"].Execute();

             DataConnections["myDataConnectionName"].Execute();

     

             DataConnections["myDataConnectionName"].Execute();

    }

    Best regards,
    Alexander Ekzarov
    Kyiv, Ukraine
    silverlightnet.blogspot.com
  • 05-11-2007 12:06 AM In reply to

    Re: Help with custom Save/Submit options for browser based forms?

    Something wrong with forum I think :(
    Best regards,
    Alexander Ekzarov
    Kyiv, Ukraine
    silverlightnet.blogspot.com
  • 05-24-2007 02:08 PM In reply to

    • GregB
    • Not Ranked
    • Joined on 02-09-2007
    • Posts 10

    Re: Help with custom Save/Submit options for browser based forms?

    How do you get the file name?  Do you have to add code to obtain?
  • 06-18-2007 08:49 AM In reply to

    Re: Help with custom Save/Submit options for browser based forms?

    Hello Board,

     I don't know if I understand the last posts correctly, but I have the following question.

     Is the a way (regardless how complex) to predefine the filename in browser enabled forms? I don't want the User to be able to set a custom filename. So when the user saves the form (not submit) the modal filename box should be prefilled or (even better) should't appear at all.

    Can someone help me with some hints?

     Regards Michael

  • 06-25-2007 06:53 AM In reply to

    Re: Help with custom Save/Submit options for browser based forms?

    Hello it's me again,

    does nobody have an idea how to manage this or can tell me, that it's definitly not possible?

    Regards Michael

  • 08-14-2007 01:21 PM In reply to

    Re: Help with custom Save/Submit options for browser based forms?

    Michael77,

    How did you resolve the issue of the Save/Submit options; I am tackling the same issue.

    Thank you

    jmamakes3
  • 08-15-2007 06:28 AM In reply to

    • buzzby
    • Top 200 Contributor
    • Joined on 07-11-2005
    • United Kingdom
    • Posts 60

    Re: Help with custom Save/Submit options for browser based forms?

    I have followed some advice from this article

    http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx

     

     

    Basically you setup a submit using the wizard and then in your on submit code you modify the submit data source. Within the data source you specify the filename (can use a formula) and specify if overwrites are allowed.

     

    Hope that helps 

  • 08-16-2007 08:16 AM In reply to

    Re: Help with custom Save/Submit options for browser based forms?

    That is the correct method. Essentially instead of save to a document library the user is doing a submit to a document library which saves but gives you more control.

    Also there is OM that can be used to set the save filename which may also work with server forms.

    Shiraz Cupala / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (12 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.