(844) docmgt1 sales@docmgt.com

 

Speeding Up E-form Loading – Part 1

When it comes to speeding up E-form loading, it usually comes down to minimizing the use of DMGET and DMGETOPTIONS and restricting what you do inside the ‘Before E-form Load’ event. This article will focus on minimizing the DMGETOPTIONS which is usually the biggest culprit. The others we will address in future articles.

 

 

Dynamic Data

It is common to fill your E-form’s option lists with options dynamically. That is, when the form loads, fill the option lists with the then-current lookup data. This is useful for user lists, company locations, and other such lists that change from time to time. Filling these lists dynamically avoids the problems associated with E-form data getting stale or having to edit multiple E-forms every time a lookup list changes.

 

 

Filling Option Lists Dynamically

The normal way to make lookup data more dynamic is to place your lookup data in Records where one Record represents one lookup value. That way, when the data changes, you only have to add, edit or delete the records and all forms and processes can use that list at any time.  To pull that data for use in E-from option list fields, you can use the DMGETOPTIONS variable. Here is the prototype for that variable:

[DMGETOPTIONS(RecordTypeID|MaxRecords|var=val^var=val=valto|ValueField|DisplayField|SortOrder|Unique|FilterField|AmountField)]

 

If you alter that call to use your Record ID and return your fields, it will return option list data with the Records that are in that Record Type.

Assume we have a Record Type that holds locations and that the ID of that Record Type is 264 and has a Name field with the location’s name. In that case, this is how we might set up that variable call:

[DMGETOPTIONS(264|0||Name|Name)]

Running the above variable in your variable tester will return something that looks like this:

New York^New York^^;Chicago^Chicago^^;Nebraska^Nebraska^^;Ohio^Ohio^^;

 

The ^ and ; characters represent the delimiters used to parse out the values into the options. The ; separates the options themselves where the ^ separates the values for each option in this order – Value, Display, Filter, and Amount. We only need the Value and Display so we did not specify the others in our DMGETOPTIONS call.

When we use this DMGETOPTIONS call in an option list’s Dynamic Source field, the variable will be run when the form loads, and the results will be parsed out to make the options for entry and display.

 

 

This all works wonderfully, and you have dynamic data just as you wanted.

 

 

The Problem with DMGETOPTIONS

The problem comes in when you have a lot of options OR if you have several option lists that you want to populate this way.  Each DMGETOPTIONS call could take a couple seconds or even more if there is a lot of data or heavy server load. Running 10 DMGETOPTIONS calls to fill 10 option list fields then would make your E-form load take at least 20 seconds! This is NOT a good experience for end users, so we need to be able to speed that up.

 

 

Caching your DMGETOPTIONS Data

If the data in your option list changes daily or weekly or monthly, or even rarely, you can cache that data at the server, so you don’t have to do searches for each E-form load. That will dramatically speed up the loading and make your users happier.

To do that, we need to store the option list data in an efficient place. Luckily, we have Server Data available to us. Server Data is just like Record Data except it is stored in the server and not tied to a particular Record. You can use Workflow or Add-In actions to put data into Server Data and use variables to retrieve it later.

Create an Add-In that is shown on the Toolbar. Then add a Server Field Update action to it. Set the name to whatever you want to call the lookup list. In this case we are using VendorLookupList as the name. Then set the value to the [DMGETOPTIONS()] call we were using in the E-form. When this runs, it will do the DMGETOPTIONS call and store the result in the server variable to be used whenever you want.

 

 

 

Using your Cached Lookup Data

Now that you have your lookup data cached, you can easily use it in your E-form via the [SERVERDATA()] variable. Use [SERVERDATA(VendorLookupList)] in your Dynamic Source field and your list will load just like before but much faster.

 

 

 

 

Refreshing Your Lookup Data

Any time you want to refresh your lookup data, you can run the Add-In you made. However, if you want to automate this, you can easily do so. simply move the Server Field Update action into an Action Set. Then call that action set from a Record Type Automation that runs nightly, weekly, or whenever. This will keep your lookup data up to date. Or call the action set inside a pertinent workflow or from an E-form save. Just make sure that wherever you call it, it does not slow down your users.

Also, if you have multiple lookup lists, you can add multiple Server Field Update actions into your Add-In or Action Set. That way you have one method to update all your lookup data sets.

 

 

Related Articles

Speeding Up E-form Loading – Part 2

E-form Automation Events

Variable Replacement