Determine which subsite called form? - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Determine which subsite called form?

Last post 12-05-2014 06:38 AM by ChrisJackson19. 38 replies.
Page 3 of 3 (39 items) < Previous 1 2 3
Sort Posts: Previous Next
  • 11-21-2014 08:00 AM In reply to

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

    Re: Determine which subsite called form?

    Sorry, I should have stated that better.

    When I am changing the url, it is to a subsite, not a completely different site. 

  • 11-21-2014 08:28 AM In reply to

    Re: Determine which subsite called form?

    Pop your form over to me via email again and I'll take a look at your logic, okay?

    Hilary Stoupa

  • 11-24-2014 07:47 AM In reply to

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

    Re: Determine which subsite called form?

    It is working with the .udcx data connection!  After figuring out what to do without a developer, and then waiting until the developer got back to set the permissions correctly, it now works like a charm!  Even the super-secret listguid parameter!!!

    As always, THANKS for your HELP!

  • 11-24-2014 07:53 AM In reply to

    Re: Determine which subsite called form?

    WHOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO HOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO!

    Good job!

    Hilary Stoupa

  • 12-04-2014 10:30 AM In reply to

    Re: Determine which subsite called form?

    Is there any documentation for the changeconnectionurl command for sharepoint list connections or examples of the required syntax? Thanks
  • 12-04-2014 11:43 AM In reply to

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

    Re: Determine which subsite called form?

    I used the Command Overview document to start with.  You'll find ChangeConnectionUrl under the Data Connection section.  I also used Dynamically Set Submission for a Form Library and a List. And a LOT of help from Hilary in this post!

  • 12-05-2014 01:06 AM In reply to

    Re: Determine which subsite called form?

    Sorry, I should have put it in context and given a bit more detail.

    I've been using qrules for quite a while now on various projects, and have read both the documents you suggested, but this is the first time i've had cause to use the ChangeConnectionUrl function.

    I specifically need the syntax or examples when you are changing the connection URL for a "SharePoint List" Data Connection, and specifically the listguid switch.

    This doesn't seem to be documented anywhere for this type of data connections despite being advertised as a new feature in v5.2.

    Thanks again.
    Filed under:
  • 12-05-2014 06:07 AM In reply to

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

    Re: Determine which subsite called form?

    Well, if you have read the first page of this message string, Hilary says:

    "So - use ChangeConnectionUrl on the connection to lists.asmx to change it to your "current" site. Query the getlist method with your list name and one piece of info you'll get back is the GUID. Use ChangeConnectionUrl with the top secret undocumented listguid parameter for your SharePoint list connection......and you will now be querying your "current" site. :) you will see that the listguid parameter is top secret and not documented anywhere yet except this message string."

    Here is what I did in my form:

    • SiteURL - Field with value = function SharePointSiteUrl()
    • GUID - Field that contains the list's GUID
    • ListName - Field for the name of the list I'm changing (Mine is set to "Agency")
    • GetListUDC - Data Connection for GetList

    On Qdabra's finishLoading parameter, I set a rule to set the current URL:

    • concat("ChangeConnectionUrl /dsname=GetListUDC /url=", SiteURL, "_vti_bin/lists.asmx")
      • Expanded:  concat("ChangeConnectionUrl /dsname=GetListUDC /url=", my:TestFields/my:SiteURL, "_vti_bin/lists.asmx")

    To get the GUID for a specific list:

    • Set a field's value:  listName (from the GetList data connection queryFields) to ListName (this is where I stored the name for my list)
    • Query using a data connection:  GetListUDC (the name of my data connection for GetList)
    • Set a field's value:  GUID to:  *[local-name() = "List"]/@*[local-name() = "ID"]
      • Expanded:  xdXDocument:GetDOM("GetListUDC")/dfs:myFields/dfs:dataFields/tns:GetListResponse/tns:GetListResult/*[local-name() = "List"]/@*[local-name() = "ID"]
      • see Hilary's excellent explanation on Page 2 of this message string.

    To retrieve the list you want with the correct URL/GUID (this is the super-secret part!!!) (NOTE:  My list name is "Agency")

    • Set a field's value:  Command (from QdabraRules) to:  concat("ChangeConnectionUrl /dsname=Agency /url=", SiteURL, " /listguid=", GUID)
      • Expanded:  concat("ChangeConnectionUrl /dsname=Agency /url=", my:TestFields/my:SiteURL, " /listguid=", my:TestFields/my:GUID)
    • Query using a data connection: mine is "Agency"

    Hopefully this makes sense. Hilary, if you happen to be looking at this, please correct anything that I have wrong, or could have been done better! =)

  • 12-05-2014 06:38 AM In reply to

    Re: Determine which subsite called form?

    klink, nice one and good detail.

    I've was having a play with it earlier this morning and got it to work, although I think I'll update my method for retrieving the list GUID to how your doing it above.

    I'm currently storing the GUIDs in a list at the site collection root (all my subsites are provisioned programmatically anyway, so only slight amendment to record the GUIDs for my lists/libraries) but your way is more robust I think (especially if people delete the list items in my root GUIDs list by mistake).

    So I guess for anyone else in the future we've got a pretty good method for doing this.

    Syntax for Changing a SharePoint List Data Connection for future reference:

    ChangeConnectionUrl /dsname= /url= /listguid=
    Filed under:
Page 3 of 3 (39 items) < Previous 1 2 3
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.