2 Dropdown Lists Control a hidden section - InfoPath Dev
in

InfoPath Dev

2 Dropdown Lists Control a hidden section

Last post 12-01-2010 03:17 PM by PAWInfo. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 11-30-2010 06:50 PM

    • PAWInfo
    • Top 200 Contributor
    • Joined on 09-14-2008
    • Melbourne, Australia
    • Posts 52

    2 Dropdown Lists Control a hidden section

    Hello,

    I do not want to write code.

    I have 2 dropdown lists. 

    1) Supplier Category (100's of items)

    2) Payment Terms (5 Entries) - Default is 25 Days EOM

    Fine Print should be hidden in most cases.

    Here is some code (Jade - see below) I wrote that works based on the the 2 dropdowns selected.

    The Fine Print should only show if not 25 Days EOM and not one of the listed Supplier Categories.

    As I can only build if Statements with 5 and/or in InfoPath, how to do this?

    pawShowField();
    // ------------------------------------------------------------------------------------
    // Created on 01 December 2010, by wakemanp
    //
    // Purpose:
    //
    // Changed On Changed By Reason
    // ----------- ---------- -----------------------------------------------------------

    // ------------------------------------------------------------------------------------
    vars
         suppCat,
         pymtMthd: String;


    begin


     read suppCat;
     read pymtMthd;
     
     if  pymtMthd = '25 Days EOM' then  //Default
         write 'Field Hidden';  //Fine Print Hidden
     else
         if  (suppCat = 'C120'
         or  suppCat = 'C130'
         or  suppCat = 'C210'
         or  suppCat = 'C310'
         or  suppCat = 'C340'
         or  suppCat = 'C430'
         or  suppCat = 'C490'
         or  suppCat = 'C520'
         or  suppCat = 'C580'
         or  suppCat = 'C700'
         or  suppCat = 'C750'
         or  suppCat = 'C760'
         or  suppCat = 'C770')
         and pymtMthd <> '25 Days EOM' then
               write 'Field Hidden';  //Fine Print Hidden
         else
               write 'Show Field';  //Fine Print Shows
         endif;
     endif;


    end;

    Fine Print:

    Payment Terms for all Vendors should be 25 days EOM, except for the following vendors:  Utility Suppliers, Rental Payments, Suppliers of Agency Staff, Payments to Contractors/Consultants (where the supply is essentially of labor), Shopping Centre Management for CS displays, Superannuation Funds, Salary  Packaging Suppliers, Insurance Brokers/Companies, Bilateral Partners in Local & Overseas Projects, Supporter Refunds, Suppliers of Legal Services, Petty Cash Float Reimbursements, Artists/Art Galleries supplying stock to Birrung Gallery, Suppliers where different payment terms have been agreed to in a contract approved by WVA Legal Team.

    PAW

  • 12-01-2010 06:43 AM In reply to

    Re: 2 Dropdown Lists Control a hidden section

    Well, I know it's a bit of a hack, but just add a bunch of rules to your first dropdown list that sets a separate hidden field to be true if any of those SuppCats are selected. Then, add a conditional formatting rule to your "Fine Print" section that comparies that separate field and the second dropdown value and there you have it. The separate hidden field should be set to default to false.

    No code needed.

    Patrick Halstead
    Project Manager at Qdabra
  • 12-01-2010 02:56 PM In reply to

    Re: 2 Dropdown Lists Control a hidden section

    And, actually, that 5 condition thing has a work around...

    Change your final condition to read "The expression" and then go to town -- the only difficult bit is you have to write out the XPath yourself in the teeny tiny space. I'd suggest a text editor, then copy it in....

    Hilary Stoupa

  • 12-01-2010 03:17 PM In reply to

    • PAWInfo
    • Top 200 Contributor
    • Joined on 09-14-2008
    • Melbourne, Australia
    • Posts 52

    Re: 2 Dropdown Lists Control a hidden section

    Thanks guys!  I will give it a shot.

    PAW

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