Copy form keeps the same URL as original - InfoPath Dev
in

InfoPath Dev

Copy form keeps the same URL as original

Last post 12-03-2008 09:54 PM by Shiva. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 12-03-2008 11:18 AM

    • cdflip
    • Not Ranked
    • Joined on 12-02-2008
    • Posts 1

    Copy form keeps the same URL as original

    I'm having to fix someone else's code. Here is the basics, after you submit the original form, you can go to that form and click on Copy button to get a replica of that form. Then you go and change whatever you need and submit it. Right now when you get the email stated that it has been submitted, it's using the original form's URL. So when you click on it, you're going to the original and not the copy one.  Here is the code behind the Copy Button:

    Sub btnCopyForm_OnClick(eventObj)

    Dim err

    'Create the form copy.

    Set fc = Application.XDocuments.NewFromSolutionWithData(objURL.Text, objURI.Text)

    On Error Resume Next

    If err.number <> 0 Then

    Call MsgBox(err.Description,64,"Error on creation of copy")

    err.clear

    End If

     End Sub

     

  • 12-03-2008 09:54 PM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Copy form keeps the same URL as original

    Hello Welcome to the Forums,

    Here is the code you have to change as below,

    Set fc = Application.XDocuments.NewFromSolutionWithData(objURL.Text, objURI.Text)

    to

    Set fc = Application.XDocuments.NewFromSolutionWithData(varXMLData, varSolutionURI, dwBehaviour)

    varXMLData -> XMLDocument type of data

    varSolutionURI -> URI of the solution

    dwBehaviour -> By default it is 1.

    If you want new solution form then code is here,

    Set fc = Application.XDocuments.NewFromSolution(varSolutionURI)

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