Problems with ChangeSubmitUrl - InfoPath Dev
in

InfoPath Dev

Problems with ChangeSubmitUrl

Last post 02-16-2015 12:08 PM by Hilary Stoupa. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 02-16-2015 05:49 AM

    • klink
    • Top 100 Contributor
    • Joined on 09-15-2014
    • Posts 99

    Problems with ChangeSubmitUrl

    The facts: 

    • InfoPath 2010
    • qRules
    • Using Web Services

    The goal:

    • To dynamically receive and submit data to several lists, depending on the site the user is in.

    What works:

    • Changing the connection url:  concat("ChangeConnectionUrl /dsname=GetListUDC /url=", SiteURL, "_vti_bin/lists.asmx")
    • Getting the lists GUID:  concat("GetListGuid /dsname=GetListUDC /listname=", ListName)
    • Changing the list connection:  concat("ChangeConnectionUrl /dsname=Agency-Location /url=", SiteURL, " /listguid=", GUID)
    • Query of list

    What DOESN'T work:

    • Changing the Submit URL:  concat("ChangeSubmitUrl /submit=SPListSubmit /url=", SiteURL, ListName)
    • On submit I get these errors:

    The form has validation errors and the submit data connection cannot execute.  
    Extended Details: Qdabra.Tools.RulesLibrary.RulesLibraryException: The form has validation errors and the submit data connection cannot execute.    
    at Qdabra.Tools.RulesLibrary.SubmitToSharePointList.Execute()    
    at Qdabra.Tools.RulesLibrary.CommandStarter.Run()    
    at Qdabra.Tools.RulesLibrary.Commands.ExecuteCommand()

    I only get these errors when I change the submit url.  I presume SOMETHING is wrong with my ChangeSubmitUrl statement, but I don't know what.  =(

     PLEASE HELP!!!  (Okay, no panic here.  But I do have a deadline of the end of the month, so any help you can give me would be GREAT!)  THANKS!

  • 02-16-2015 07:38 AM In reply to

    Re: Problems with ChangeSubmitUrl

    Well - that error is specifically about the main data source having validation errors. You can add a ClearErrors command to clear these - do you have required fields that are not filled out when you run your SubmitToSharePointList command?

    Also- the SubmitToSharePointList command uses the SharePoint URL from the mapping file - so instead of using ChangeSubmitUrl here, you will want to actually change the mapping node that contains the SharePoint URL - the node in the mapping file is SharePointListURL.

    Hilary Stoupa

  • 02-16-2015 07:49 AM In reply to

    Re: Problems with ChangeSubmitUrl

    I realized I should have included a bit more information, sorry. :)

    So - SubmitToSharePointList uses a Submit data connection. That means that when the data connection is executed (as it is during the SubmitToSharePointList command), InfoPath checks the validation on the main data source. If there are validation errors, the submit data connection can't execute, and the command returns an error.

    The ClearErrors command will clear the validation errors for the session (so you want to use that with care, as you may not want a user to be able to submit a form with validation errors) - you know about the GetErrors command, I think we discussed it in a different post.

    ChangeSubmitUrl won't have the outcome you desire for your SubmitToSharePointList command, since the command is already using the URL from the mapping file, not from the data connection. So a rule to just change that URL in the mapping file should give you the result you want.

    Hilary Stoupa

  • 02-16-2015 08:02 AM In reply to

    • klink
    • Top 100 Contributor
    • Joined on 09-15-2014
    • Posts 99

    Re: Problems with ChangeSubmitUrl

    Argh.  It's Monday, I've been gone for a week, and I am brain-dead.  So-ooo, this statement:

    ChangeSubmitUrl won't have the outcome you desire for your SubmitToSharePointList command, since the command is already using the URL from the mapping file, not from the data connection. So a rule to just change that URL in the mapping file should give you the result you want.

    How do I change the URL in the mapping file?  =(

  • 02-16-2015 08:09 AM In reply to

    Re: Problems with ChangeSubmitUrl

    You just use a normal rule? And set the node in the mapping data connection to the URL you want?

    Hilary Stoupa

  • 02-16-2015 08:20 AM In reply to

    • klink
    • Top 100 Contributor
    • Joined on 09-15-2014
    • Posts 99

    Re: Problems with ChangeSubmitUrl

    I get the rule.  I don't get how to set the node in the mapping data connection.  =(

    So, here's my submit:

    SubmitToSharePointList /submit=SPListSubmit /mapping=mappingAgencyLocation

    Is there a node with the url?  ARGH!

  • 02-16-2015 08:25 AM In reply to

    Re: Problems with ChangeSubmitUrl

    Yes. As I said above - the node in the mapping (which you have a data connection to) is SharePointListURL. So, in a rule right before your SubmitToSharePointList rule, you select "Set a field's value". For the field to set, select the mapping data source - looks like yours is named mappingAgencyLocation. In that data source, select the SharePointListURL node. Set it to whatever the site is supposed to be that you are submitting data to. You'll also need to make sure in your mapping XML you've set it to use the list name - feel free to attach your mapping fie if you want me to check that. You can go to the Data tab in the ribbon, and under Resources, find and export the mapping file.

    Hilary Stoupa

  • 02-16-2015 12:04 PM In reply to

    • klink
    • Top 100 Contributor
    • Joined on 09-15-2014
    • Posts 99

    Re: Problems with ChangeSubmitUrl

    Found out that my form was somehow corrupted, hence why I was getting the errors.  Went back to an earlier version.  So, here's where I am...

    Added a rule to set SharePointListURL = SiteURL (which is the subsite URL).  I am getting this error:

    The list that is referenced here no longer exists.  =(

    Found an article that said this:

    If your site URL is http://my_share_point_site, the list.asmx can be found at http://my_share_point_site/sites/main/_vti_bin/lists.asmx?WSDL and you could use that URL to reference the API and some things might work. When you attempt to update a list found under some sub_site, your updates will silently fail. You have to reference http://my_share_point_site/sites/main/sub_site/_vti_bin/lists.asmx?WSDL for updates to your subsite.

    I tried adding that the the url and didn't get an error.  However, it updated to the main site, not the subsite.  ARGH!

    I'm going to send you the mapping file in an email...

    THANKS!

  • 02-16-2015 12:08 PM In reply to

    Re: Problems with ChangeSubmitUrl

    Well - I'm guessing that your mapping file uses the list GUID - so when you change the URL, the list can't be found - there is no list on the new site w/ the same GUID. I'll fix up your mapping file and email it back to you.

    Hilary Stoupa

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