Technical Tuesday: Doug Johnson's Handy Code Snippet Tutorial

Doug Johnson | April 28, 2015

Acumatica: A Web Application

Acumatica is a web application. This means that all pages are created using HTML, using the syntax you see below. Acumatica utilizes the features of HTML5 to take advantage of new features such as browser cross-compatibility, mobile optimization, video playback (from dashboards), and advanced caching for improved performance.

Acumatica's Technical Tuesday

Web Application Integration

The web allows different applications to interact with one another. Common web integration techniques include web services, APIs, and code snippets. In this article we explain how Acumatica simplifies the process of integrating applications that require adding information into the Header section of the HTML document for each Acumatica page.

To demonstrate, we will add a code snippet so the WalkMe service (WalkMe is an interactive, cloud-based guidance platform-read more here) can display screen overlays to guide users through the process of learning the system. Other examples include Google analytics (if you want to use it to analyze your ERP usage), marketing automation system (such as Hubspot), and other tracking/measuring software applications.

Adding WalkMe to Acumatica

For the WalkMe service, we will copy/paste a script (a.k.a. code snippet) into two different files on the Acumatica ERP site.

1. Locate code snippet

In this example, the WalkMe Service provides a piece of java script that needs to be installed on all pages you want to be supported by WalkMe. The code must be installed into the HTML section because this section is executed before the data in thesection is rendered and displayed. An example of the snippet for Acumatica’s Test environment is provided below.

2. Add snippet to Acumatica ERP website

In order to add a snippet to the Acumatica ERP website, you need read/write access to the files on the server that is running Acumatica ERP. For a cloud deployment, you'll have to contact Acumatica support.

When running Acumatica, type a URL, for example: http://tryacumatica.com/walkme. This is linked to a screen called main.aspx that is used to render the site. This makes it easy to apply snippets because you do not have to modify each individual page.

The main.aspx file is located in the root of website folder. This is illustrated in (1) below.

The main.aspx file is located in the root of website folder

To add the snippet, open main.aspx using an editor such as Notepad and copy/paste your code as illustrated below.

To add the snippet, open main.aspx using an editor such as Notepad and copy/paste your code as illustrated below.

Note that this code will be executed on all pages access by the site.

3. Adding Snippet to Login Page

Prior to login, you are redirected to the login screen. The login screen does not utilize main.aspx, so your snippet will not appear there.  After logging in, the page "main.aspx" is used to render the site.

What are Master Pages?

In addition to main.aspx, Acumatica application pages reference several master pages for their design and layout. The application pages contain the business logic, but rely on the master pages for display.

The example below is from the Journal Transactions screen. In this case the FormDetail.master file is referenced.

The example is from the Journal Transactions screen. I this case the FormDetail.master file is referenced.

Notice that in the Acumatica ERP website, there is a directory called “MasterPages” that contains these files. In the case of the login page, we have to add the code snippet to the page called Login.master located in this directory.

The result of adding the snippet to login.master is illustrated below. In this master file, the HTML header tag contains additional code that is not related to the integration.

The header page in this case contains more information

After this is complete and saved, the code snippet will execute when you run Acumatica.

Wrap Up

After installation, the snippet runs a script. The script contacts the Cloud Application maintained by WalkMe and inserts additional help screens and menus on top of the Acumatica application. Using the power of the web, this is done without interfering with the Acumatica application.

The snippet runs a script after installation

This is just one example of the options of an inter-connected web application; other examples of connected-application tools include web analytics, marketing automation systems, and reporting tools.

Doug Johnson

Director of Partner Programs and Enablement at Acumatica. Doug is in charge of showing people the specifics about what makes Acumatica’s Cloud ERP software awesome for our customers and partners. For other tips and technical training, stay tuned on Tuesdays.

Subscribe to our bi-weekly newsletter

Subscribe