This article describes how the OutFile module is used within the Lasernet 9 Default Configuration for the Dynamics 365 Finance and Operations Lasernet Connector.
The OutFile output module in the default configuration is used as a type of storage for D365 F&O. This type of storage may be used for OnPrem solutions that do not use Azure Storage and, instead, use a file system to print reports.
Setup in LAC
Follow these steps within the F&O to set up the module:
1. Navigate to Lasernet > Setup > Administration > Connections.
2. Create a new connection with Connection Type: Storage, Type: File System, and specify a Directory path.
This connection will be LAC’s output location and Lasernet input location.
4. Go to Lasernet > Setup > Administration > Lasernet Servers.
5. Create a new Lasernet server. Give it a Server name, Description, Default for, and make it Active.
6. Set your Outgoing connection to the file input created in step 2.
7. Set your D365FO connection to reports storage to the file output created in step 3.
The D365FO connection to reports storage’s Connection’s Type determines the OutStorageType jobInfo in the XML. In this case, the OutStorageType will be FileSystem.
8. On Lasernet Server > Lasernet Developer > Modules, ensure ListeningOnFiles is Active and the Directory Path matches the Outgoing Connection on your Lasernet server in step 3. If this is completed and deployed, the Lasernet Server in LAC will Validate successfully.
9. Try printing a report to this server from D365FO. As a test, print to Lasernet Screen.
10. Review the XML file generated by LAC. OutputFilePath is populated with the path you determined in the Connection. OutFileStorage is populated, and OutputStorageType is FileSystem.
Process in the Lasernet Server
Follow these steps:
1. Navigate to the Lasernet server > Lasernet Developer > Modules.
2. Select the Destination Selection Pass-Through and select the Destinations tab.
The OutFile output module in the Default configuration depends on the jobInfo runOutFile = true.
This jobinfo is set in script setCriteriaVariables().
3. Close the Destination selection Pass-through , select Scripts.
4. Scroll down to LAC Functions and double-click on setCriteriaVariables().
5. Scroll to the line where var runOutFile is set. Variable runOutFile will only be true if the jobInfo OutStorageType is FileSystem, the job is not a printOut, the file is a PDF, and both OutFileStorage and OutFilePath are not empty. All these conditions are met with the setups carried out in LAC.
How to stop XML from being saved in the File Output Folder with a PDF
There are two ways to avoid having an XML file saved in the File Output Folder with a PDF.
The first way is to disable Archiving. Follow these steps:
Open FO and navigate to Lasernet > Reports > Archive.
In the Archive field, select No.
The second way is to enable Archiving with Save XML disabled. Follow these steps to do so:
Select Default under the Archive field.
Toggle the Save XML to No.