Conditional Formatting to hide or display a section - InfoPath Dev
in

InfoPath Dev

Conditional Formatting to hide or display a section

Last post 10-09-2015 09:28 AM by PeteC. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 10-09-2015 08:16 AM

    • PeteC
    • Not Ranked
    • Joined on 10-09-2015
    • Posts 12

    Conditional Formatting to hide or display a section

    I'm working on an expense form that requires receipts for expenses to be attached unless the expense is a parking meter, in which case no receipt is required.  The expense claims are in a repeating table, with a field for mileage, a field for expenses, and a checkbox to indicate if it was a parking meter expense.  The form is laid out as follows:

    Group: MileageExpenses
    Repeating Table: expenseLineItem
       Field: Distance
       Field: Expenses
       Checkbox: meterParking
       hidden Field: subTotal (calculated as rate * distance + expenses)

    I then have another section called Attachments.  I have a conditional format to hide this section, and the expression I defined as: count(../my:expenseLineItem/my:Expenses[. > 0]) = count(../my:expenseLineItem/my:meterParking[. > 0])

    It's not working, and I'm not sure why not.  The logic seems to be fine: if the count of Expenses fields larger than zero equals the count of meterParking fields with a tick, then I'm assuming all Expenses are meters, and no attachments are required.  When I run the form, the section is hidden, and it doesn't matter how many lines with expenses I add, the section never appears. 

     

     


  • 10-09-2015 09:28 AM In reply to

    • PeteC
    • Not Ranked
    • Joined on 10-09-2015
    • Posts 12

    Re: Conditional Formatting to hide or display a section

     I figured it out...because the rule was running on the different section instead of where I was originally placing the attachment, my path changed.  I should have had:

    count(../my:MileageExpenses/my:expenseLineItem

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