The 'setDatabaseConnection()' Script Is Missing
    • 19 Jun 2024
    • 1 Minute to read
    • Contributors
    • PDF

    The 'setDatabaseConnection()' Script Is Missing

    • PDF

    Article summary

    When the setDatabaseConnection() script is missing from your script list with the new configuration for Lasernet Dynamic 365 AX 6.1.0.1 and newer, it is added to the default configuration 6.1.0.4.

    Multiple Azure Storage Connections Support

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

    1. Ensure you have the 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.

    1. Click Scripts from the Tools menu, and paste the new method called setDatabaseConnection into the Workspace.

    
    // 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'));
    }
    }
    1. Insert the line setDatabaseConnection(prefix); into the downloadAzureServiceBusResponseXML() function.

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

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

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

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

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


    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.