Generate Document from Microflow -- Document appears in list, but then disappears
Hi, I've set up a document template and microflow to generate a document per the directions here: https://docs.mendix.com/refguide/how-to-create-your-own-documents. When I click the button I created to generate a document (by calling the MF), it appears to work correctly. If I navigate to a page that shows a list of the generated documents, the document appears on the list. However, when I go to another page, then come back to the list of generated documents, the document is gone. This happens regardless of what object from a list i call the MF from. I have a model with an "RFI" 1:m "Requests" 1:1 "Request Document" (and I've tried this with and without a return relationship "RFI" m:m "Request Document". I've tried setting the association when the "Request Document" is created (per the tutorial). I've tried commiting the "New Request Document" after calling the "Generate Document" action. I've tried setting the association from the REquest object to the Request Document object after the Request Document is created. No matter what, the documents appear to be created, and then mysteriously disappear. Any suggestions much appreciated.
A few ideas come to mind:
do you commit the FileDocument entity after creating the document?
have you created an page listing all of the Request Document objects independent of any associations? i.e. just a datagrid on a page? This could show you if you are creating a whole bunch of documents without proper associations to Requests.
do you have permissions set up so that the logged in user has rights to view the newly created documents?
Hope those ideas help you resolve this.
Hi lize, you also might want to check the status of the filedocument object when debugging. Here you can check whether the object is committed or still instantiated at the end of your microflow.