Validation Rule Conundrum - InfoPath Dev
in

InfoPath Dev

Validation Rule Conundrum

Last post 02-29-2012 08:23 AM by nkstrou. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 02-29-2012 08:23 AM

    Validation Rule Conundrum

    Hi InfoPathers:

    I've got an unexpected validation rule behavior that I need a little help making sense of.  In my InfoPath 2010 filler form, I have my users enter something called a Product Categorization.  This consists of a repeating table that contains a radiobutton choice indicating whether their request pertains to an existing or new Prod Cat, or one they want to have deleted.  (Changes are entered as a new and a deletion.)  Then there are 3 catgory comboboxes and a Product Name combobox for the Product Categorization and a 5th one for an alias.  I look up the Prod Cat values from a SP 2010 list and have a cascade set up across all 5 comboboxes that works great.  When they enter a new Prod Cat, I do a lookup against all Prod Cat values on the SP list to make sure they are entering a unique value.  I do the same for the alias, and both of those pieces work great.

    But I got to thinking that if we are talking about an existing Prod Cat or one that needs to be deleted, I want to make sure they populate the Alias value for that record if there is one (right now, we have maybe 4 records out of 800+ that have aliases).  That's where my funky behavior is coming in.  My Prod Cat controls are named as follows:

    • optProdCatXstNewDel for the Existing/New/Deletion option buttons
    • cboProdCatTier1 for Tier 1 of the Categorization
    • cboProdCatTier2 for Tier 2 of the Categorization
    • cboProdCatTier3 for Tier 3 of the Categorization
    • cboProdCatProdName for the Product Name
    • cboProdCatAlias for the Alias.

    On the SP list, the Prod Cat fields are as follows

  • Tier1 for Tier 1 of the Categorization
  • Tier2 for Tier 2 of the Categorization
  • Tier3 for Tier 3 of the Categorization
  • ProductName for the Product Name
  • Alias for the Alias.
  • The validation I have so far looks like this:

    optProdCatXstNewDel is not equal to "New" and

    optProdCatXstNewDel is not blank and

    ../my:cboProdCatTier1 = xdXDocument:GetDOM("CurrentProdCats")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Title and

    ../my:cboProdCatTier2 = xdXDocument:GetDOM("CurrentProdCats")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Tier_x0020_2 and

    ../my:cboProdCatTier3 = xdXDocument:GetDOM("CurrentProdCats")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Tier_x0020_3 and

    ../my:cboProdCatProdName = xdXDocument:GetDOM("CurrentProdCats")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Product_x0020_Name and

    cboProdCatAlias is blank and

    Alias is not blank

    (And yes, I think I hijacked what was originally the Title field on the SP list and renamed that to Tier1.  The d:Title thing is what I get when I set up cboProdCatTier1 = Tier1 and convert that to an BLOCKED EXPRESSION

    For purposes of discussion, let's taking the following two sample Product Categorizations:

    Prod Cat 1                                                Prod Cat 2

    Tier 1 = Miscellaneous                               Miscellaneous

    Tier 2 = Account                                        Account

    Tier 3 = Kerberos                                      Kerberos

    Product Name = Unclassified (UN)             Classified (CL)

    Alias = Kerberos Account (UN)                  Kerberos Account (CL)

    The validation I've set up kicks on when I enter the Tier 3 value, but I want it to not kick in until the Product Name is entered.  Given that these are the only two Prod Cats that match to the Tier 3 level and both of them have aliases, I suppose I'm not completely surprised by this behavior.  If I change Tier 3 to something like Local Machine, which doesn't have any aliases associated with any of the records that match at that level, I have other rules that automatically clears out the Product Name and the Alias.  That part works, but the validation prompt stays turned on when it shouldn't.  If I go in and pick Miscellaneous --> Account --> Local Machine as a first-time pick, the validation prompt also turns on.

    I'm looking for a way to find any records on the SP list that match on all 4 tiers of whatever is selected for Prod Cat in my form (for existing or delete requests) and if that record has an alias that hasn't been entered in my IP form, bring that to the user's attention so they can pick it.  But it's the like the actual behavior is find any record that matches at any entered tiers of the Prod Cat, and if any of those have an alias that hasn't been picked, bring that to the user's attention so they can pick it.  Which is impossible due to the cascades I've set up and leaves me with a validation rule whose requirements can't be met.

     Does anyone have any ideas what might be going on?  Or whether there's a different/better way to do what I need it to do? 

    Thanks,

    nkstrou

    An imprecisely defined requirement has an infinite number of possible solutions. Unfortunately, only about a maxiumum of 3 solutions are actually satisfactory to the end user.
Page 1 of 1 (1 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.