Skip to main content

When the 'setDatabaseConnection()' script is missing - Knowledgebase / Lasernet / Lasernet Developer FAQs - Formpipe Support Portal

When the 'setDatabaseConnection()' script is missing

Authors list

 When the "setDatabaseConnection()" script is missing from your script list with the new configuration for Lasernet Dynamic 365 ax version 6.1.0.1 upward. It is added to the default configuration 6.1.0.4.

Multiple Azure storage connections support

Since 6.1.0.1 LAC fully supports multiple Azure storage connections, the following steps have to be completed to update the Lasernet configuration:

1. Ensure you have default Azure storage configuration called “Azure Storage”. This will be used as a fallback destination if the connection is not specified.

2. Ensure all Azure Storage Blob commands have '#DatabaseConnection#' specified as their connection.


3. Click the Scripts option in the Tools menu, and paste the new method called setDatabaseConnection into the Workspace.

Script
// Sets Database connection for outgoing file function setDatabaseConnection(prefix) { if (job.getJobInfo(prefix + 'StorageType').toLowerCase() == 'AxDocuments'.toLowerCase() || job.getJobInfo(prefix + 'StorageType').toLowerCase() == 'AzureStorage'.toLowerCase()) { if (job.getJobInfo(prefix + 'StorageConnection')) { job.setJobInfo('DatabaseConnection', job.getJobInfo(prefix + 'StorageConnection'), true); } else { job.setJobInfo('DatabaseConnection', 'Azure Storage', true); // Azure Storage is default } logger.logEvent(0, 'Setting database connection: ' + job.getJobInfo('DatabaseConnection')); } }


4. Insert the line setDatabaseConnection(prefix); into the downloadAzureServiceBusResponseXML() function.

5. Insert line setDatabaseConnection(prefix); into the setOutParameters() function.

6. Disable the Upload metadata result to Azure within the properties of the module GetMetadataInformation.

7. Ensure the Azure Storage module OutAzure as a connection is set to #DatabaseConnection#.

8. Save and update the Lasernet configuration. This will restart the Lasernet service.

If you running Azure Service Bus Queue to pass messages for Lasernet, wait about one minute until the connection with the queue is re-established.

Helpful Unhelpful

Add a comment

Please log in or register to submit a comment.

Need a password reminder?

Share