Expression box working vs Field not working - InfoPath Dev
in

InfoPath Dev

Expression box working vs Field not working

Last post 05-24-2010 06:35 AM by Jimmy. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 05-21-2010 09:00 AM

    Expression box working vs Field not working

    I have an expression box with the value...

    xdXDocument:GetDOM("GetWhosWho")/dfs:myFields/dfs:dataFields/ns3:GetListItemsStrResponse/ns3:GetListItemsStrResult/Rows/row/Email[../Region = xdXDocument:get-DOM()/my:myFields/my:FormCalculationsGroup/my:TopNonBlankRegionalGroup and ../Role = "Regional EVP"]

    And this brings me the correct value (email) from my secondary data source GetWhosWho

    I have a field with the same xml...

    xdXDocument:GetDOM("GetWhosWho")/dfs:myFields/dfs:dataFields/ns3:GetListItemsStrResponse/ns3:GetListItemsStrResult/Rows/row/Email[../Region = xdXDocument:get-DOM()/my:myFields/my:FormCalculationsGroup/my:TopNonBlankRegionalGroup and ../Role = "Regional EVP"]

    The field does not bring me back any value.

    I think the xml for the TopNonBlankRegionalGroup (a field) is fully defined (ie.starts at the root).  I can't see why it does not return a value.

    Can someone please point me in the right direction.

    Thank you

    Catharine.

  • 05-21-2010 09:20 AM In reply to

    Re: Expression box working vs Field not working

     Have you tried setting the field's value by placing a rule on TopNonBlankRegionalGroup, instead of just using the default value setting?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 05-24-2010 03:03 AM In reply to

    Re: Expression box working vs Field not working

    Hi,

    I have added a rule and now have a value.

    Is there a Rule of Thumb I should use as to when to use a rule and when a default value will work ? 

    IF default values don't always get refreshed when expected - is it best not to use them at all ?

    What would your advice be ?

    Catharine

  • 05-24-2010 06:35 AM In reply to

    Re: Expression box working vs Field not working

    It seems that default values act funny when there is a multiple selection list box involved.  I would have thought that wouldn't be an issue here, because the default value involves TopNonBlankRegionalGroup, which is not in a multi-select list box, but maybe it has something to do with the whole chain of events being set off by a change in a multi-select list box.

     When multi-select list boxes are involved, the answer is usually to use a default value and a rule.  Rules don't fire when an item is unchecked in a multi-select list box, and default values don't work when an item is checked.

    I don't really have any advice beyond that at the moment.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.