Author Topic: Search results non-deterministic on first result?  (Read 1681 times)

john.christopher

  • Member
  • *
  • Posts: 8
Search results non-deterministic on first result?
« on: December 02, 2013, 01:19:40 PM »
Maybe I'm missing something, but PCAB_OpenFirstRecord doesn't seem to behave as expected.  Calling it a second time seems to advance the cursor to the next record, while still returning the UID of the first record.  Calling PCAB_OpenNextRecord after calling PCAB_OpenFirstRecord twice returns the UID of the second record, but the properties retrieved are still from the first record.

I'm perplexed.

Code:
Code: [Select]
List (
PCAB_Search ( "Group" ; "Name" ; "" ; "" ; "z" ; "NotEqual" ; "" );

PCAB_OpenFirstRecord;
PCAB_GetValueForProperty ( "Name" ; "" );

PCAB_OpenFirstRecord;
PCAB_GetValueForProperty ( "Name" ; "" );

PCAB_OpenNextRecord;
PCAB_GetValueForProperty ( "Name" ; "" );

PCAB_Open ( "647318B4-173E-4A8A-9E9E-7FC18BCBB5B9:ABGroup" );
PCAB_GetValueForProperty ( "Name" ; "" );
""
)

Actual Result:
Code: [Select]
10
647318B4-173E-4A8A-9E9E-7FC18BCBB5B9:ABGroup
c'ville
647318B4-173E-4A8A-9E9E-7FC18BCBB5B9:ABGroup
dc
3B3FFCEB-509E-49A1-AA3C-25730D38A1E4:ABGroup
c'ville
0
c'ville

Expected result:
Code: [Select]
10
647318B4-173E-4A8A-9E9E-7FC18BCBB5B9:ABGroup
c'ville
647318B4-173E-4A8A-9E9E-7FC18BCBB5B9:ABGroup
c'ville
3B3FFCEB-509E-49A1-AA3C-25730D38A1E4:ABGroup
dc
0
c'ville

It appears to me that I can work around this by using the search ONLY to retrieve UIDs to then call PCAB_Open on each UID.

john.christopher

  • Member
  • *
  • Posts: 8
Re: Search results non-deterministic on first result?
« Reply #1 on: December 13, 2013, 12:49:26 PM »
To be clear, what I see happening here is that PCAB_OpenFirstRecord always returns the UID of the first record in the found set, but subsequent calls to PCAB_OpenFirstRecord actually advance the cursor to the next record, rather than returning the cursor to the first record.

Jerel Malong

  • Global Moderator
  • Member
  • *****
  • Posts: 97
Re: Search results non-deterministic on first result?
« Reply #2 on: January 17, 2014, 08:52:21 AM »
I tested your script steps and received the "expected results". (See Attached Screenshot) Are you still experiencing this issue?