Hello again,
I can now successfully update a parent document from one of it’s children. However when I am returned to the parent document and make a change and then try and save I get prompted to create a conflict document. This is because the parent document has not been refreshed to show the latest available information (changed from child doc).
Here is the process
-
Open parent document.
-
Create a child document (response doc) to allocate some time to a project. When the child document is saved the parent document is then updated with the extra time.
-
However I would then like to make a futher edit to the parent document. I do this and then save it but am prompted to create a conflict doc.
No matter where I try to put refreshfields or reloadwindow I still get the same problem.
Can anyone help ?
Thanks
M
Subject: Updating parent doc from child causes edit problems
quick question: when you save the response, how is the parent updated? By LS? If so, are you including a doc.Save on the parent?
Subject: RE: Updating parent doc from child causes edit problems
Jon,
I update the parent using this code -
@Command([FileSave]);
id := @Text($REF);
temp := @Subset(@GetDocField(id;“CallWorkTime”);1);
@SetDocField(id; “CallWorkTime”; temp + CallTimeMins);
@PostedCommand([FileCloseWindow])
The parent doc is being saved because when I am returned to it I can then click close. If I go back into the parent (i.e. refreshing) then the new data is there.
Does this help ?
Matt
Subject: RE: Updating parent doc from child causes edit problems
Matt, the reason I ask is based on your description:
- However when I am returned to the parent document and make a change and then try and save I get prompted to create a conflict document. This is because the parent document has not been refreshed to show the latest available information (changed from child doc). *
Notes creates conflict docs when the sequence number is the same for more than one doc -
ie: each time a doc is opened and resaved the sequence number is advanced by one. if the doc is opened by two separate people at the same time or on different servers and then saved they would both be advanced by one and notes creates the conflict.
Looking at the parent update formula I’m not completely sure that your parent is then being resaved. Check the sequence number on the documents. If they have not advanced after the update code runs, you may want to try to do the update by script - including a doc.Save
Subject: RE: Updating parent doc from child causes edit problems
i guess another question I have is - are 2 copies of the document actually open at the same time - in other words when you say you go back into the document…