Dynamic Data Connections - InfoPath Dev
in

InfoPath Dev

Dynamic Data Connections

Last post 02-09-2007 12:49 AM by happydigit. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 02-06-2007 03:52 AM

    Dynamic Data Connections

    Hello,

    I have a question: How can I send and receive between my browser enabled InfoPath form and SharePoint Lists and Libraries? In my scenario I have two SharePoint servers

    1. Development and testing server
    2. Live System

    In InfoPath I define the data connections static: I saidhttp://servername and so on... how can I configure this dynamically?
  • 02-06-2007 10:10 AM In reply to

    Re: Dynamic Data Connections

    Hi Sebastian,

    The best way to do this is to use InfoPath 2007's UDCs. If this is unavailable you could try changing the data connections in code depending on where the form is being opened from. I don't know the exact syntax and I'm away from my dev box right now, but it'd go something like this: Put this code in the OnLoad.



    OnLoad()
    {

    //...

    string sURI = thisXDocument.SolutionURI; // This might be on thisApplication

    switch( sURI )
    {
    case "http://devServer":
    UpdateDataConnections( "http://devServer/DataconnectionString" );
    break;

    // Fill in the rest here
    }

    //...

    }

    private void UpdateDataConnections( string uri )
    {

    // Not sure if it should be DataAdapters or DataObjects
    //foreach( DataAdapter adapter in thisXDocument.DataAdapters )
    foreach( DataObjects adapter in thisXDocument.DataObjects )
    {
    if( adapter instanceof WebServiceAdapter )
    adapter.URI = uri;

    }
    }


    Hopefully you catch the drift, but if you hit problems, let me know!
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 02-09-2007 12:49 AM In reply to

    Re: Dynamic Data Connections

    Thanks a lot. I solved the my problem by using UDCX Files. The think is, that a have to eit these files later if I use another system because at current time it is not possible to design formlibrarys and content type as a feature.

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