Domino 9 und frühere Versionen > Entwicklung
How can make an update on a doc link ?
Toma Bogdan:
The situation:
- database A with doc X
- database B with doc Y
- database C with 0 doc
I create a doclink to Y (placed into db B) from into doc X (placed into db A) with AppendDocLink from an scheduled agent ! Then I move the doc Y from database B to database C !
How can I make it so the link from doc X (placed into db A) to route to doc Y (placed into db C) ?
PS If there are many docs from db A that have a link to the same doc Y (even this have been moved to the db C), how can I proceed to have a good link ?
thanks !
Rob Green:
in the moment you move the doc to a new db you have to place actively a new doclink and delete the first doclink. There is no updating method. BUT if you have more then one doclink in docX you have serious probs to identify the right link. You may find a reserved field "$links" but you cant work with them in LS. There is no known method to handle doclinks with LS at all, there are just some turn arounds with Notes API (look at the gold forum at http://www-10.lotus.com/ldd).
Toma Bogdan:
It seems that another ideea is when I move the doc Y from db B to db C to check all the docs from db A to see if these are related to doc Y (use NoteID - it is unique in a db) and if the link (NoteID+CrtDbName) isn't valid to rebuild the DocLink with NoteID+NewdbName !
it is a good idea ?
Rob Green:
to trigger such an event "on the fly" you should choose the view event "Query Paste" and the database event "QueryDocumentDelete" (depending on the given process en detail).
But once again: in your first posting you refered to the notes in-built "doclink" object, now you´re speaking about another kind of relation. However, true doclinks arent accessable by Script or any other built-in Notes method, just Notes API (which i dont know about). Whatever kind you choose, you can trigger it as aforementioned.
Couldnt you generate something in a way of a mapping table? A central document, inheriting all doc-relationships. Any movement is logged through and about that document. No doc-links, just
1. "Doc A.."UNID" > inherited in "Doc B" .."UNID"
2. "Doc C.."UNID" > inherited in "Doc E" .."UNID"
...
based on this you could design your further needs
Toma Bogdan:
yes, I can use the Postdocumentdelete or Querydocumentdelete event to control the update of the docLink (with the AppendDocLink method).
When I move the doc Y from db B to db C, I will delete the doclink of the doc X and then I will updated it (create again) with a new doclink to the doc Y from the db C !
With this method I don't need to use another form into db A or a doc to keep all doc-relationships ! Isn't it ?
:o
Navigation
[0] Themen-Index
[#] Nächste Seite
Zur normalen Ansicht wechseln