2 Replies Latest reply on Aug 14, 2018 2:23 PM by redball58

    AFSearch question

    redball58

      Is it possible to search for elements that have an attribute value without using a template?  I understood with AF-SDK 2.10 that I could cast value type.

      Attribute will always be a string.  Can my value be a wildcard?

       

      I am getting the following exception: A template was not defined for the attribute path '|LocationCode'

       

                  int count=1;

                  string query = @"Root:'FacilityName' '|LocationCode':='0776-03-*'" ;

                  using (var search = new AFElementSearch(afdb, "", query))

                  {

                      foreach (AFElement item in search.FindElements(0, true, 1000))

                      {

                          Console.WriteLine("{0}: Element {1} has {2} Attributes.  Path:{3}", count++, item.Name, item.Attributes.Count, item.GetPath());

                      }

                  }