Drill down with secondary source - InfoPath Dev
in

InfoPath Dev

Drill down with secondary source

Last post 03-08-2007 06:46 AM by stumbler. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 03-07-2007 01:17 AM

    Drill down with secondary source

    Hello,

    Since you experts solved my first question (thanks nukkumatti), I go for another one.

    I have a secondary source (SQL table) containing EmployeeID, EmployeeInfo and Department.
    I'd like to populate 1 dropdownbox with the departments en than drill down to the employees in that department.
    1) How do I populate the second dropdown with all employees from the 1 selected department?
    2) Is it possible to have a 'Show all' in the departments?

    There is no department present in my main source, only the EmployeeID

    Thank in advance for any given advice. (Infopath 2003)
    Hans.
    Infopath 2003 / Jscript
  • 03-07-2007 04:22 AM In reply to

    Re: Drill down with secondary source

    Hello again Mr Belgium,

    you are actually not that far away from me. sitting here in Luxembourg, but anyway played around a bit and here is the solution for your first question:

    that you can easier follow here my datasource structure:

    dfs:myFields/dfs:dataFields/d:tblMachines
    within this data source I have @Expr1 and @Expr2

    Now double click your frist dropdown list and select "look up values from secondary....".
    Under entries select your repeating node (in my case the path you can see above)
    As value and display name select "department" in my case Expr1.

    Now do the same with your second drop down list and select "employeeID" (in my case Expr2) as value and display name.
    Now click on the button next to Entries of your 2nd DDL and select "Filter Data"
    In the first drop down list of the filter options select "department" in the second "is equal to" and in the third select "use formula" and write current()/my:nameOfYourFirstDDL.
    Now take care the system propably switched back the value and display name of your second drop down list form department to employeeID, so you have to change this one more time.

    That is actually it, just one more thing you need to take care of:

    Double click your first drop down list and select Rules, click add, click add action, select Set A Fields Value, select your second drop down list as the field and leave the last row blank. like this you can make sure that you always have on the employees of the last selected departments in your second ddl.

    Hope this helps.

    Could you please describe your other question a bit more detailed.
    Listen to Motörhead cos they play Rock'n Roll :)
  • 03-07-2007 06:13 AM In reply to

    Re: Drill down with secondary source

    What I have so far:
    One Dropdownbox getting the different Departments
    - bound to (@orgunitno(ActiveEmployees))
    - based on seconday connection /dfs:myFields/dfs:dataFields/d:ORGANISATIONUNIT
    - both display name and value are set to @orgunitDescr
    One Dropdownbox getting the employees
    - bound to @employeeID (main data source)
    - based on secondary connection /dfs:myFields/dfs:dataFields/d:EMPLOYEE[@OrgUnitDescr = current()/my:OrgUnitDescr]
    - display name = @EmployeeName, value = @employeeID

    But the second dropdown doesn't get populated. And once again, beeing a newbie, I have no clue.


    Concerning the second question, Is it possible that when no department is selected, that all employees are shown?
    Hans.
    Infopath 2003 / Jscript
  • 03-07-2007 06:53 AM In reply to

    Re: Drill down with secondary source

    Okay regarding your second question i would use a third drop down list to keep things simble. set conditions to both (2nd and 3rd) ddl, hide one when your 1st ddl is blank and the other when it's not blank. for your 3rd you can then just use your secondary datasource.

    Back to your first problem could you please post the structure of your secondary datasource, is it only one or two ?
    Listen to Motörhead cos they play Rock'n Roll :)
  • 03-07-2007 07:14 AM In reply to

    Re: Drill down with secondary source

    My datasources:
    /dfs:myFields/dfs:dataFields/d:ORGANISATIONUNIT contains information concerning the departments
    Fields OrgUnitNo,OrgUnitDesc,Department,Unit
    /dfs:myFields/dfs:dataFields/d:EMPLOYEE contains information concerning the employees
    Field EmployeeID, EmployeeName, OrgUnitNo

    My first dropdownbox is bound to the departments datasource.
    The second is bound to the main data source entry employeeID.
    I work in this way, because my main connection does not contain a department and I can't figure out how to make it possible to select a department first.
    Or can you point out a better way to get the desired result.

    I already want to thank you for your patience. I can imagine that you can find better pupils than I am :).

    Kind regards
    Hans.
    Infopath 2003 / Jscript
  • 03-08-2007 06:46 AM In reply to

    Re: Drill down with secondary source

    nukkumatti,

    I solved the problem in another way: I've added the department to the main data source.
    No I can populate each dropbox like I want.

    Anyway thanks for your help. I may become a fan of you, but I don't think I will ever become a fan of Motörhead.
    Cheers!
    Hans.
    Infopath 2003 / Jscript
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.