lotus notes - parentView property in NotesDocument class -


i have function calls function - bones shown below.

when second function runs , reaches 'set doc = view.getnextdocument(doc)' line, parentview property on unrelated notesdocument, doc1, updated, breaking original loop.

any thoughts?

function getdept(){  dim doc1 notesdocument  dim view1 notesview  .  .  .  set doc1 = view1.getfirstdocument   while not(doc1 nothing)  .  .  .   call getdeptnumber()  .  .  .   set doc1 = view1.getnextdocument(doc1)   }   function getdeptnumber(){   dim doc notesdocument   dim view notesview   .   .   .   set doc = view.getfirstdocument    while not(doc nothing)   .   .   .    set doc = view.getnextdocument(doc)    } 

it's driving me nuts!

thanks

graeme

it's little unclear without seeing more code, suspect problem may have caching. if access same notesdocument different views, second , subsequent accesses may end using same document have in memory in part of code. using view entry collection shown in other answer help. set view's autoupdate property false also.

but can't notice code not organized or efficient. looks subroutine (which has no parameters, assume using global variables -- bad idea when can avoid it) creating new view object every time it's called. that's expensive. also, seems iterating through view purposes of looking value, inefficient. use sorted view , search value using methods of view, instead.

when need view object, suggest make method fetch once , store in class property don't have search database view more once.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -