Views:

Overview


The following describes all the fields that make up a formula. Using a combination of the fields below you can defined when a formula is executed & either where the result of a formula goes or what action it performs.  A formula is stored as a CRM record and edited via a specially adapted form.
 

Name

The name of the formula. This is automatically generated by the system but can be modified at anytime. The name of the formula is used if you are using formulas of type Calculated Field, Calculated Hyperlink or any of the Notification formula types. Note the short code field in the top right-hand corner which is an auto generated by the system & is effectively the a short name for a formula. 


Formula Type

  • Action  : Allows you to connect a North52 formula to a Dynamics 365 Action. 
  • AutoNumber: Select this option when you need to generate an auto number which increments by defined value.
  • Calculated Field: Select this option when you need to just display the results of a formula on an entity form.
  • ClientSide - Calculation: Executes a formula on the client side which can be used with other javascript code.
  • ClientSide - Perform Action: Allows you to perform a client side action such as hide tabs, show form notifications, set field focus, etc.
  • Command Console: Allows you to execute any ad-hoc formulas against your CRM system.  Ideal when you just want to update some data within your CRM system. 
  • N:N Associate:  Allows you to execute a formula whenever a many to many relationship is created.
  • N:N Disassociate: Allows you to execute a formula whenever a many to many relationship is removed
  • Process Genie: Allows you to execute a formula as part of a dialog, workflow (realtime or async.) or an action.
  • Save - To Parent: Select this option when you need the result of the formula to be saved to a parent of the source entity. These are typically for N:1 relationships.
  • Save - To Current Record: Select this option when you need to save the result of the formula into a field on the same entity as the source entity.
  • Save - Perform Action:   Select this option when you want to execute a formula on the Save event of a record. 
  • Validation: Select this option when you need to provide validation of data within fields. This allows you to stop a user from entering in data on a form unless is passes your data validation requirements.


Mode

This picklist controls the pipeline stage that the formula will execute within. The options are as follows,

  • Client Side:  Execute a formula just on the client side. This would be in reaction to either a form OnLoad, OnSave or field change events.
  • Server Side: Executes a formula just on the server side.
  • Client & Server Side: Executes a formula on both the client and server side.


Pipeline Stage

This picklist controls the pipeline stage that the formula will execute within. The options are as follows,

  • Pre-Validation (Synchronous):
  • Pre-Operation (Synchronous):
  • Post-Operation (Synchronous):
  • Post-Operation (Asynchronous):

This is an advanced feature & should only be changed from its default if you have a solid understanding of the Dynamics 365 pipeline architecture. You can read about the pipeline architecture by referring to Microsoft's own documentation on this at Microsoft's MSDN website at this link, Event Execution Pipeline.


Event

This allows you to specify the event that needs to occur on the source entity for the formula to execute. The options are as follows,

  • Create 
  • Create & Delete
  • Create & Update
  • Create, Update & Delete
  • Delete
  • Update
  • Update & Delete


Source Entity

The source entity is in effect the trigger entity. This means when a record from this entity gets created or updated then potentially the formula will be executed. 


Source Property

This allows you to control if the formula executes for the source entity when an event occurs. The formula will only execute for the properties on the source entity that have changed.

Note 1: This field is only applicable when updates occur on the source entity. It is not applicable for creates.

Note 2: You can select multiple properties within the on-screen control by using the CTRL or SHIFT to select multiple properties.


Relationship

When the formula type is set to Save - To Parent this field allows you to pick the relationship between the source entity & its parent. This parent is an entity which then sets the Target entity.  This field is only active when the formula type is set to Save - To Parent.

e.g. If the source entity is Opportunity then you can choose the relationship customerid (Account). This means that the target entity will be set to Account as this is a parent of the opportunity.


Target Entity

This allows you to specify the entity that you want to use to place the result of the formula into a property on the entity. This field is only active when the formula type is set to Save - To Parent, Save - To Children, Save - To Current Record.

e.g. If you need to set a field on the Account entity then you set this field to Account.


Target Property

This field allows you to specify the field on the Target Entity that you want the result of the formula to be placed into. This field is only active when the formula type is set to Save - To Parent, Save - To Children, Save - To Current Record.

e.g. If the Account entity is the target entity then you can choose "Account Number" as the property you want to set.


Formula Description

This is where you can enter the formula description. It is this formula that executes each time the formula is triggered.

Tracing Level

This is allows you to turn on tracing for just one single formula. This tracing will output to the N52 Trace entity within Dynamics 365. Here you will find all the system generated information about the execution of your formula.


Execution Order

This field is used to specify the execution order of formulae that are hooked into an entity. This is primarily used when you want to use the output of one formula as the input to another formula. This means that you can effectively daisy chain formulae together that are all related to one entity, pipeline stage & pipeline event combination.

The Execution Order field just takes a whole number as input so if you set it to 1 this will be the first formula to execute & if you set it to 2 then this would be the second formula to execute for one entity, pipeline stage & pipeline event combination.

 If you don't set anything for the Execution Order field then the formulae execute in the order of their created on date.


Category and Subcategory 

The purpose of these fields is to allow you to add metadata about the formula. 

So it is best to think of it like adding tags to a formula so you might want to tag all the formulas regarding a certain business process. 

For example you might have four formulas for recurring invoicing so you could set the category text file to be all "Recurring Invoicing"


Fetch-Xml Queries

These are static and\or dynamic Fetch-Xml queries that can be executed as part of the formula and the results used in your formula logic.  


Formula Values Section 

The values in these fields are set as result of selections made in the main section of the form. There is no need to edit the values stored here. 

 

Version 

An auto-generated GUID used to track different versions of the formula. Used when deploying formulas from DEV to TEST.

 

Owner 

A standard CRM Owner field. 

 

Deployment Solution 

Select the CRM solution you wish to add the formula to for deployment. The formula is added as a XML web resource and allows the formula to be easily transferred between Development / Test / Staging and Production systems.  

Comments (3)
  • Is it possible to escape a single quote in a string for input to a function?

    I have tried consecutive quotes 'My name is ''John''' and \ 'My name is \'John\'' but to no avail
  • This escaping method should work for you. Any issues just email support. 

    John \'O Connor
  • Just fixing up where the single quote should have been for an Irish surname :)

    John O\' Connor