8.4.7 Export Accounting Records with MuleSoft

Table of Contents

1. Introduction 

This document contains detailed step to step instructions to deploy the MuleSoft template to MuleSoft CloudHub. 

What does this application do?

  • This app will retrieve / export Accounting Records, convert data into CSV format, save the CSV file to a FTP server.

  • Customer can configure the fields of Accounting Records to export.

 

2. Reference URLs 

Download and configure Anypoint studio for any of the OS that you are using. 

3. Where to Download our MuleSoft Application? 

Download our MuleSoft application (filename advendio-csvexport.jar) by downloading the attachment below

  File Modified

Java Archive advendio-csvexport.jar

2020-03-30 by Benhui Chen

4. How to Import a Project in Anypoint Studio? 

  1. Select Import from the File menu. 

  2. In the Import wizard, click to expand the Mule folder, select Packaged Mule Application (.jar), and then click Next.

  3. In the File field, click the ellipses (...) button to explore your local drive.
    Then select the Mule Deployable Archive file (that is, the advendio-csvexport.jar file) you want to import.  

  4. Click Finish. 

5. Update configuration with required credentials

After importing the project to AnyPoint Studio, open config.yaml located at: src/main/resources.

Add the following details:

  1. Salesforce username, password, and security token.

  2. SMTP details for email notification. 

  3. FTP details where you want to push CSV files. 

Test the application in the sandbox environment once your changes are complete. 



6. Steps to Change Scheduler Time

The default schedule to query SF is set to a fixed frequency of 30 seconds. However, you can change it to best suit your needs. 

Below are the steps to change scheduler timings 

  1. Open advendio-csvexport.xml file located at src/main/mule 

  2. Double-click on Scheduler in GetRecord 

  3. Click scheduling strategy, it has two types of frequency: 

    1. Fixed Frequency

      1. Option to select time unit in Days, Hours, Minutes, Seconds 

    2. Cron 

      1. You can add Cron expression, refer http://www.cronmaker.com for creating Cron expression based on your needs. 

      2. Has option to add timezone ID (refer java.util.timezone for timezone IDs)





7. Upload Template to MuleSoft Runtime Manager 

Once the above changes are done and the application is running successfully on Sandbox, point it to the production instance. 

Now, it’s time to upload your application to MuleSoft Runtime Manager. 

Follow the steps below to upload: 

  1. Right-click on project folder in Anypoint Studio 

  2. Go to Anypoint Platform and click on Deploy to CloudHub option 

  3. Enter credentials of anypoint platform if prompted 

It will prompt a window as below, fill in the required details for Name, Deployment Target, application file.

Leave runtime properties as it is and click on Deploy Application. It will take a couple of minutes to deploy and your application will be up and running. In case of an error, please review the error log messages.


Â