GreenTech

Element Search ignores version

Discussion created by GreenTech on Sep 26, 2011
Latest reply on Oct 27, 2011 by pcombellick
Hi Folks, We're using the AFelement.FindElementsByCategory method and what we found was unexpected. If we create a version of an element, delete it's children (some or all, weak or strong reference), despite the database query-date being greater than the original version, a call to 'FindElementsByCategory' returns all of the original elements. This happens in code or with the 'advanced search' options in system explorer. This effect has thrown a huge spanner in the works for our project and basically precluded the use of versions for the time being. The only way I can think around this is to itterate through all of the found children and determine if it is _currently_ a child of the specific parent using the 'Find Parents'(which seems to use the current version). AF Guys: surely this is not designed behaviour? The attached zip file has all of the steps I used to demonstrate the problem (.rtf) and an export of the tiny database used. (.xml) This may be related to my other post about .children = true but .element.count =0 (i.e. one of them may be taking into account all versions of the object). Any help gratefully appreciated. My version info (AFSDK 2.1.1.3624, Winsvr2007sp1/64 (client & server), VS2008, .Net 3.5SP1) (is there something wrong with my version of carriage returns? They look fine in the 'Compose' tab)

Outcomes