preceding-sibling returns common error (field not valid) - InfoPath Dev
in

InfoPath Dev

preceding-sibling returns common error (field not valid)

Last post 03-24-2016 07:35 AM by Hilary Stoupa. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 03-23-2016 05:35 AM

    preceding-sibling returns common error (field not valid)

    hey guys, I've scoured the net a bunch of times regarding the sensitivity of the preceding-sibling w/ InfoPath. I am including screenshots for reference, however, essentially I have the same problem everyone else has proclaimed. A repeating section needs to autonumber each time it is inserted. The formula I was using is as follows: count(../preceding-sibling::my:PDL/my:HQFR/my:HQ-SubTask/my:SubTaskDeliverables) +1 in a calculated field. when I try to use this formula, I get an error that the field cannot be located. however, if i do this formula: count(preceding-sibling::*)+1 it works fine except that it starts at the number 5 instead of 1. please note the images.... also note, the fields within the 'SubTaskDeliverables' are reference fields if that makes any difference. any help would be greatly appreciated; i am tearing my hair out. also note, that i've copied the xpath and still get the same error. even more curious, i have a similar calculated field with the same formula [for the HQFR section) which works perfectly.
  • 03-23-2016 05:02 PM In reply to

    Re: preceding-sibling returns common error (field not valid)

    Is the formula in a calculated value? or is it a default value in a field? I think your XPath here needs to either be count(../preceding-sibling::my:SubTaskDeliverables) + 1 or count(preceding-sibling::my:SubTaskDeliverables) but I'd need to see your form to be sure.

    Hilary Stoupa

  • 03-23-2016 10:32 PM In reply to

    Re: preceding-sibling returns common error (field not valid)

    It's in a calculated value. I tried the former, and still got the same error unfortunately. I have tried count(../preceding-sibling::*[1]/my:SubTaskDeliverables)+1 and that worked, however, it doesn't actually count the sections lol. so when you go to insert the repeating section, the calculated value returns 1 indefinitely. Thanks for your comment! I really appreciate it.
  • 03-24-2016 07:35 AM In reply to

    Re: preceding-sibling returns common error (field not valid)

    Can I either see your form or see a screenshot of the schema? I'd think if the calc'd value is in a repeating table or section bound to my:SubTaskDeliverables the formula count(preceding-sibling::my:SubTaskDeliverables) + 1 would be correct.
    Hilary Stoupa

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