Views:

Fully Secure 

xCache uses Microsoft Dynamics Field Level Security to secure your xCache records.

By default only System Administrators have access to the xCache records

However if you want to give other users (Functional Consultants and Business Analysts etc.) read access to the records, then you can do the following:

  • Create a new security role called N52 Read xCache
  • Customization Tab: Read on Solution
  • Custom Entities: Read N52 xCache

This will allow the users to see and open the xCache Records. However the secured values will be hidden from them. 


You can also use different field level security profiles for System Administrators and other users if you want to split out who can read / write / edit secured xCache Records.

Performance Improvement

Since xCache is loaded directly into memory, you can use it to store values that are read often but not updated regularly.

Temperature Sensor

Consider a workflow that is used to create records based on updates from a temperature sensor in a country-wide weather forecasting network. There are thousands of sensors each reporting in every 15 minutes resulting in hundreds of thousands of workflows being triggered daily.

The workflow goes to the database to retrieve the historic average temperature for time slot and then saves a new record to the database indicating that the new reading is higher / lower or equal to the average temperature.

Each week you would have millions of database calls for essentially the same information - What is the average historic temperature for Ireland in Week 17 at 3.15 pm.

Instead of storing that data in database records, you store them in xCache records that expire weekly and you can take tremendous pressure off your database. 
The workflow no longer executes a select and then create, instead only the create record instruction hits the database.

Also the read time from memory is much much faster than from a database improving the overall performance of the CRM system as well.  


xCache and Find Value

xCache is clever when it comes to using FindValue.

In a Single Formula
If you are using separate FindValue calls to the same record in CRM retrieving different values each time then N52 BPA will automatically compress the separate FindValue's into a single execution. It will cache the other values until the formula needs them.
This way you only query the database 1 time instead of multiple times for same record.

In a Workflow
Imagine you have a workflow with many different steps, including N52 Process Genies. If you execute a FindValue in a Process Genie step then the data from that FindValue will be automatically cached and be available to be used within any other steps that query that same record.

Note: The cached information only exists for the workflow that is executing, not any child workflows it spawns.

Turn off xCache with FindValue
In some cases you may not want N52 BPA to cache the results of your FindValue, perhaps if are changing a value and want only the fresh data later on in your workflow or formula.

To do this you can add optional parameter to the FindValue call.

FindValue('entityname', 'searchAttribute', 'searchValue', 'valueReturned', 'defaultValue', 'noLock?', 'cache?')

Example: FindValue('account', 'name', 'Fourth Coffee', 'accountid', '?', true, false)
The above formula will return the Guid of the account in CRM with the name of Fourth Coffee.
The database query will execute with no lock turned on and it will not cache the result.

Note: You can learn more about No Lock a.k.a READUNCOMMITED here
Nolock is disabled by default in FindValue functions.

Refreshing xCache

If you go to your North 52 configuration record you will see the following section


The Refresh Cache Interval (Secs) tells BPA how often a CRM application server should check the Database to see if it should update any of the cache. 30 seconds is standard although in Production systems you could choose to increment the value to 60 seconds if you want to reduce any unnecessary load on your database.

Refresh Formula Cache indicates when the last time this was updated. This will update when a new formula is created or an existing one is updated.

Refresh User Cache stores information about the users in the system such as their default language, working time etc. This does not update automatically, If you, or users, have made user config changes then you must manually refresh this cache.

Go to Settings -> Customizations -> Solutions and click on 'Publish all Customizations'
That will force the refresh.

Refresh Metadata Cache indicates the last time all the metadata in N52 was updated. This will update when there is a change like adding a new field to a form etc.

Refresh XCache shows when the last time actual xCache records were updated. This value will change when an xCache record is created or an existing one is updated.

Retain Values

This setting is for use in Production systems.

Scenario: You have 3 systems: Dev, Test, Production
Your CRM integrates directly with SharePoint and uses an Admin Username and Password thereby granting full access to CRM.
You have 3 xCache records set up for each of the environments.

For Dev and UAT this password is the 'Test1' and you have multiple users in the systems with System Admin access (developers, functional consultants, testers etc.). You have  a dummy password in the Production xCache record.

In Production system you have the actual password. As you migrate the North52 solution forward between environments, you don't want to overwrite the production password.


In the Production system you select Yes for the 'Retain Values to this Org' option after you enter the valid password.

When a new solution is imported that contains new xCache records, the Production password is not updated with the dummy password from Dev / Test and instead retains the valid password.

Finally if you choose to export the xCache records into a new system the retained record will not be exported with the rest of the records, thereby ensuring the Production password doesn't accidentally end up in a Test system.