Drop Down List display name - InfoPath Dev
in

InfoPath Dev

Drop Down List display name

Last post 07-19-2006 10:48 AM by pengbo. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 07-16-2006 10:34 AM

    • pengbo
    • Not Ranked
    • Joined on 07-16-2006
    • Posts 4

    Drop Down List display name

    I have 3 cascading drop down lists sourced from a database in a repeating table which are working perfectly now thanks to Greg's tutorial.

    Now I need a summary view that just lists the details of the order. So I created a new view and constructed a layout that uses expression boxes to give a summary. Only problem is the drop down list values are all the ID's of the relevant data from the DB tables and not the display names... they have to be the ID's or the cascade doesn't work as that is where the relationship is.

    Any suggestions how I get the display name and not the value? Had a good look around and it seems to me it's not going to be possible as the data source container doesn't know anything about the lookup in the database just the value it is storing.

    Currently only have a vague idea of creating a data source item in the repeating group that is read only to hold the relevant display name and getting it to update using a rule. Is this possible? if so how do you get a rule on the drop down list so that when the user is filling in the form and makes a selection the display name is set in the read only field as well? I did say it was only a vague idea :)
  • 07-17-2006 10:22 AM In reply to

    • pengbo
    • Not Ranked
    • Joined on 07-16-2006
    • Posts 4

    Re: Drop Down List display name

    Ok getting further but a bit stuck.

    I have a new field in the repeating item node now called iCostCentreAccount and I am trying to set this with a rule on the data entry form.

    If I use the following rule

    xdXDocument:GetDOM("Cost Centres")/dfs:myFields/dfs:dataFields/d:Cost_Centres/@CCen_Account[../@CCenID = current()/my:aCostCentre]


    I get nothing in the query view. but if I use:

    xdXDocument:GetDOM("Cost Centres")/dfs:myFields/dfs:dataFields/d:Cost_Centres/@CCen_Account[../@CCenID = xdXDocument:get-DOM()/my:purchaseOrder/my:items/my:item/my:aCostCentre]


    which is why I thought I needed current()/my:aCostCentre in there like you do for the cascading DDL's but obviously still to new to this to get the hang of the XPaths.

    Anyone suggest where I should put the current() in the second formula?
  • 07-18-2006 09:56 AM In reply to

    Re: Drop Down List display name

    Hm, that looks right, but current() can get tricky sometimes. What I like to do to debug is to put the formula local-name(current()) into the node that you are trying to use this formula with and then you will know exactly what node you are dealing with and how you should reference your aCostCentre node.
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 07-19-2006 10:48 AM In reply to

    • pengbo
    • Not Ranked
    • Joined on 07-16-2006
    • Posts 4

    Re: Drop Down List display name

    I went and did a search for xdXDocument:get-DOM to see if there were any other examples knocking about and it turns out that it works if you make the filter part

    ../@CCenID = xdXDocument:get-DOM()/my:purchaseOrder/my:items/my:item/my:aCostCentre


    like this:

    ../@CCenID = current()/../my:aCostCentre


    ... I think. Going from memory and the code is in work.

    Thanks for having a look anyway Matt.

    On a bit of a downer with this ATM as I need the username I think and the only way seems to be with certificates and managed code :( Really don't want to fight with Visual Studio if I don't have to and the certificates part just plane scares me :(
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.