Set one table's values from another table. - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Set one table's values from another table.

Last post 03-06-2012 09:38 AM by shniggens. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 02-27-2012 01:40 PM

    Set one table's values from another table.

    I have a 2ds table in my form.  I select items from this table with a quantity field, then copytable over to my main data source if quantity is greater than or equal to 1.  I have formatted the rows in my 2ds to be shaded if an item has already been selected.  I want to also show the quantity of these items in my 2ds based on what the quantity is in my main table (by comparing specific values). 

    I tried a SetValue command - concat("SetValue /dsname=GearList /xpath=/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Need[../d:GearID='", GearID, "'] /value=", Need[Item = Item])

    This works correctly for the first instance it finds only.  So, even though it sets it correctly, it only sets the first row that meets the criteria. 

    Is there another way of doing this?

  • 02-28-2012 07:59 AM In reply to

    Re: Set one table's values from another table.

    This command should be iterative - that is, it should set all instances - mind you - it will set them all to whatever Need[Item=Item] is at the time the command is run. Anything in the error node? Can you test with a hardcoded value (like /value=Test) and see if all instances of Need get set where the GearId matches?

    Hilary Stoupa

  • 02-28-2012 09:10 AM In reply to

    Re: Set one table's values from another table.

    I set it with a hard coded value, and it's still only setting the first instance.  Is there another way besides SetValue that may work for this?

  • 02-28-2012 12:50 PM In reply to

    Re: Set one table's values from another table.

    Yeah - you can manually modify the rule in the manifest - here's a blog post on that. What version of qRules are you using?

    Hilary Stoupa

  • 02-28-2012 01:05 PM In reply to

    Re: Set one table's values from another table.

    I'm using version 3.3.4220.29644

  • 02-28-2012 03:20 PM In reply to

    Re: Set one table's values from another table.

    I'm having a very hard time understanding your scenario and what you're trying to do.  Could you go into a bit more detail, perhaps give us a mental picture of the steps that would be taking place here?  When would you be triggering this rule action?
    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 02-28-2012 03:39 PM In reply to

    Re: Set one table's values from another table.

    The 2ds table that is displayed in my form has items to order.  The user enters the quantity of the item they want in this 2ds table.  When they are ready to order these items, they click a button that CopyTable from the 2ds to my main data source table (let's call it "Ordered Items")  The CopyTable has a filter so it only copies rows with a quantity > 0. 

    I have a formatting rule on my secondary data source table that shades the rows that have already been selected (copied to the main data source).  For now, I am just hiding the quantity field in the 2ds of items that have already been selected, but I would rather show the quantity selected and disable this control. 

    There are a couple of other factors involved, too, but I won't get in to that yet. 

  • 02-28-2012 05:23 PM In reply to

    Re: Set one table's values from another table.

    Hello again,

    Instead of hiding the quantity field, why not just disable it?  I think that would accomplish what you're describing, or am I missing something?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 02-28-2012 06:54 PM In reply to

    Re: Set one table's values from another table.

    Right, except I query the 2ds after the CopyTable, because . . . .

    I have 3 drop-downs for criteria that the user chooses before ordering items.  These 3 criteria are concatenated into a field in the main table after the CopyTable; after rows have been added to it.  The reason for this is, I may need to order the same item from 2ds for different criteria, 

    So user picks the criteria, orders the items in the 2ds, copies table, criteria field set in main data source table, 2ds table is flushed and ready to go for a new criteria. 

     The criteria is also concatted into a field outside the table for filtering purposes.  So if criteria in main table != criteria outside of table, it hides the rows.  If criteria in main table = criteria outside of table AND main table item = 2ds item, it shades the 2ds rows, and (hopefully) sets the number that was ordered for this criteria.

     

  • 03-06-2012 09:38 AM In reply to

    Re: Set one table's values from another table.

    No ideas?

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