in a relational database, there are two fields that are parent-child relationships. With the recursive algorithm, enter a parent ID to get all the corresponding child IDs. This data structure is often used in the organization architecture. The display generally uses a tree-shaped structure. In Domino the same can handle this situation, below is a small demo, I hope to be helpful to everyone. Communication QQ 873968102
1) View of the data structure (this data structure is used in some applications where this is the foreground UI xpages Domino Dynamic Edit tree)
2) The following is a recursive algorithm that uses LS to bring out all the child IDs by entering a parent ID. By: Delimited, other Java, Ssjs writing similar, do not write out.
Some students want to. Why get all the sub-IDs? For example, to delete an ID, first get the child ID together. Then the current ID and child ID are all deleted.
%rem View First second column recursive data view,id to global variable%end Remdim ID asstringfunction tempstring1 (key as String) asstring Dim VC1 Asnotesviewentrycollection Dim entry1 as Notesviewentry Set Vc1=view. Getallentriesbykey (key,true) Set entry1=vc1. Getfirstentry While not entry1 are nothing If id= "" Then id=cstr (Entry1. Columnvalues (1)) Else id=id & ":" & CStr (Entry1. Columnvalues (1)) EndIf tempstring1=id & ":" &tempstring1 (CStr (entry1. Columnvalues (1))) Setentry1=vc1. Getnextentry (entry1) wend endfunction
Domino uses recursive algorithms to get view values