Expressions are in the core of this solution. They are used to set up autonumbers, they are used to create advanced filters, they can be used in the workflow activities, etc.
Basically, expressions are similar to plugins and they are executed on the server. Unlike the plugins, they don’t have to be compiled – instead, they are parsed and executed on the fly. Unlike the workflows, you can use C#-like syntax in the expressions.
Moreover, you have access to the basic C# types (DateTime, int, string, etc) and associated methods/properties. Don’t expect anything fancy like linq.. But you can use the following constructs:
- Standard arithmetic operators(+,-,*,/)
- “new” (with most of the basic types)
- if (“else” is not yet supported. As a workaround, use multiple if-s)
- No need to declare variables
- Anywhere in the expressions, you can use “entity” keyword to access the entity records for which this expression is being executed
Expressions can be registered for “create”, “update”, “delete”, “retrieve”. As of this version, they are always executed in the “pre-operation” mode.
Here are a couple of examples of valid expressions
i = 30;
while(i < 20)
i = i+2;
function test(i, j)
To create an expression in CRM, and choose “CRM Expressions” under “CRMA”:
In the next post, I’ll walk you through the process of creating an actual expression.
You can download CRMA solution from crmassistant.net