Current() and Data Crossover .... again !! - InfoPath Dev
in

InfoPath Dev

Current() and Data Crossover .... again !!

Last post 03-12-2012 08:42 AM by Robert Hansen. 14 replies.
Page 1 of 1 (15 items)
Sort Posts: Previous Next
  • 11-30-2009 08:25 AM

    Current() and Data Crossover .... again !!

    Firstly allow me to apologise in advance, I know this question has been asked and answered before in other posts, and I have read every single one, but for the life of me i can not get it to work on my form. The issue im talking about is Look-up Fields in a Repeating table, data crossover and utilizing “Current()”  PRIMARY DATA SOURCE + myfields+Datafields+ d:RFC_Main            + RFC_Main_Software_Releases (Repeating)   ID   Product_id  (Drop_down – queries Products)    Product_Ver (Drop_down  – queries Product_Version) SECONDARY DATA SOURCES + myfields+Datafields+d:Products     Prod_id          Prod_Name + myfields+Datafields+Product_Version  Ver_id  Prod_id  Prod_Vernum  So the first drop_down “Product_id” queries the “Products” SDS, stores Prod_id but displays Prod_Name The second drop_down “Product_Ver” queries the “Product_Version" SDS and lists all versions related to that Product_id.  The expression is as follows :-  xdXDocument:get-DOM()/dfs:myFields/dfs:dataFields/d:RFC_Main/d:RFC_Main_Software_Releases/@Product_id = ../@Prod_id 


     

    This works fine for the first row, but as soon as soon as get to the second row it will list the Products ok, but I get the version numbers associated with the previous product code as well. I have attempted to use current() in various locations and swapped the referencing around, but I can not work out where I should be applying it and with what syntax.  Any help would be most appreciative as i am at a deadend and need to resolve this to move on with my project. 

     

  • 11-30-2009 08:34 AM In reply to

    Re: Current() and Data Crossover .... again !!

    I didn't think the current() function was available in 2003.  If it is, then I wouldn't try to type it manually, but rather build the data filter statement with the GUI, which automatically invokes the current() function, or at least it does in 2007.  If you _have_ to write it manually, then check some other threads that show the syntax and try to follow it.  You'll need an example that shows the full XPath, though.

  • 11-30-2009 08:54 AM In reply to

    Re: Current() and Data Crossover .... again !!

    Looks like the formatting of my post has gone all funny, despite me using the Preview function 

    Unable to use Infopath 2007 as i still have people using Inforpath 2003.  The Current() function is used in IP 2003 and there are many posts on the forum stating this problem. You are right though IP 2007 does this automatically.

    I've checked other threads, looked at various syntax and still can not get it to work .... im desperate !! :(

  • 11-30-2009 10:56 AM In reply to

    Re: Current() and Data Crossover .... again !!

    That last time I participated in a thread on this topic, it was not a function that was usable in 2003 although the function was recognized when resolving it in the function builder.

    Really should get all users on IP2007 (Office 2007 actually) so as not to be restricted and so that they're not 2 versions behind in Office, but there's probably nothing you can do about that.  However, with IP2007, you could use browser forms as long as you have MOSS Enterprise so that it doesn't matter what your users have.

  • 12-01-2009 02:59 PM In reply to

    Re: Current() and Data Crossover .... again !!

    Hi -- can you attach a copy of your form to a reply? You can do this under the options tab. You can use current() in rules and in filtering in IP 2003, which is what I gather you are trying to do... filter a drop down list?

    Hilary Stoupa

  • 12-02-2009 04:12 AM In reply to

    Re: Current() and Data Crossover .... again !!

    Hi Hilary,

    thats exactly what i am trying to do, filter a cascading drop down list in a repeating table :)

    Is it possible for me to send the form direct to you, i think my company would have issues me sharing database structure info to all and sundry. ?

     

  • 12-03-2009 08:26 AM In reply to

    Re: Current() and Data Crossover .... again !!

    As I mentioned in my email, try:

    The expression ../@Prod_id = current()/@Product_id

    in your filter on your rows...

    Hilary Stoupa

  • 12-04-2009 01:25 AM In reply to

    Re: Current() and Data Crossover .... again !!

    What can i say, the lovely Hilary has come to my rescue,...that worked a treat.

    I was obviously over complicating the whole process, although im still trying to get my head around the whole syntax. I will take your advice and upgrade to IP7, and make use of its functionality.

     Many thanks again Hilary.

  • 03-06-2012 12:00 PM In reply to

    Re: Current() and Data Crossover .... again !!

    Hello, Hilary,

     With the help of Microsoft Support, I was able to successfully use the current() function in the XPath code in a repeating table. A few years later, I am developing a new form using InfoPath 2007 and SP 2007, but am saving it in InfoPath 2003 format since my users still have InfoPath and SP 2003. 

    As you know, the current() function is now able to be built and used without manual code editing. 

    The field on which I am using the current() function populates properly when I test it on my machine, but will not populate at all for the users who fill out the form. They don't get any error messages - there's just no data pulled into the form from my secondary data source. 

    It seems that way current() is now employed is making it unusable unless all users are also on the 2007 version.  Is this your understanding too?

    Thanks very much,

    Bob Hansen 

     

  • 03-06-2012 12:12 PM In reply to

    Re: Current() and Data Crossover .... again !!

    Okay - so it has been a long time since I've looked at this, so I am going by memory here (and we know what that can be like).

    In IP 2003, if I recall correctly, we could use current() - but not in default values. So you had to use rules to set your field's value if the current() function was needed. I think that if you create an IP 2003 compat form in IP 2007, the IP 2003 user would still experience this issue - defaults with current() would not work correctly, but rules would.

    So - in your scenario - are you having troubles with defaults? Or rules?

    Hilary Stoupa

  • 03-06-2012 12:50 PM In reply to

    Re: Current() and Data Crossover .... again !!

    Thanks a lot for the quick response.

     We have actually been using current() in the default value, in a repeating table, and have been were able to pull values when a field (account number) matched in both primary and secondary data sources.  Now that I am creating my new form in IP 2007, the values are only pulling in for people using IP 2007.

    Would I be able to send you a copy of the form?  It doesn't have a lot of fields on it.  I don't know offhand how to attach it to this message.

    Thanks. 

     

  • 03-06-2012 02:03 PM In reply to

    Re: Current() and Data Crossover .... again !!

    You can attach it to a reply under the Options tab - I'm not sure how much help I can be as I no longer have IP 2003 installed anywhere.

    Hilary Stoupa

  • 03-07-2012 07:16 AM In reply to

    Thanks a lot, Hilary.  Maybe there's something you can see or think of, even if you don't have the older version.  I'm attaching a copy of the form here.

    There are actually 4 fields with this same issue, but the first one occurring in the main datasource is called "PrinBal" (myFields/MainTable/PrinBal).

     Bob

  • 03-07-2012 08:31 AM In reply to

    Re: Current() and Data Crossover .... again !!

    Your syntax looks correct, and since it is working in IP 2007, I'd anticipate it is correct.

    Like I said, my only recollection on issues with current in IP 2003 was the use of it in default values. If this were my form, I'd try setting rules on the AccountNumber field to set these other fields and remove the default values and see if it works for the IP 2003 users.

    Hilary Stoupa

  • 03-12-2012 08:42 AM In reply to

    Re: Current() and Data Crossover .... again !!

    This worked perfectly, in both IP 2003 and 2007.. 

    I can't thank you enough!

    Bob

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