Using Qlikview 12.20 on Windows server 2012 R2
I have a QmsApi application in which I copy a file to a newly created folder under the source documents root. I then need the DocumentNode object corresponding to that document, so I call the GetSourceDocumentNodes(QdsServiceInfo.ID, SourceDocFolder.ID, RequestedRelativeFolder) api function to get that. Sometimes the function returns nothing, but this call is always made only after the copy is finished. I have tried looping 10 times with 250 ms sleeps and calling the function over and over. I have tried adding a call to ClearQVSCache(QVSCacheObjects.All) after the file copy and that does not solve the problem.
Overall purpose here is to create and run a couple of publisher tasks on the document, so I need to DocumentNode object for that purpose.
Is there a reliable strategy for me to copy a file into the source documents and then get a DocumentNode object associated with that file?