FAV Plugin Configuration Options

Note: Plugin configuration must be a valid JSON structure contained within the CDATA section of an XML string. Please refer to a configuration example file 'Ex2_Contact2AccountRollup_ContactValidationAndFormula.xml'.

RulesForEntities -> this is the root node of the configuration object
  • Key = “{entity name}” -> this can be set to any system or custom Dynamics CRM entity, and it will be the source entity from which action is taken
  • Value (public class – RollupRulesForEntity)
    • EntityName = “{entity name}” -> must be exact match to RulesForEntities>Key
    • Rules -> an array of RollupRules
      • Name = “{a specific description of the formula, validation, or rollup}”
      • SourceSetting -> object containing rules for plugin operation from source Dynamics CRM entity
        • FieldName = “{Dynamics CRM schema name from source entity}”
        • ReactToAnyFieldChange = {true or false} -> If set to true, change in any field in entity will cause plugin to run.
        • CrmStateCodes (CrmStateCode List) -> a List of filter conditions for FetchXML query of CRM source entity records
          • Value = “{integer that matches CRM statecode value}”
          • Name = “{label for the CRM statecode}”
        • Formulas (FieldFormula class) -> each term within the square brackets within the formula expression will be evaluated by the system to a CRM field value. For additional information on writing expressions and formulas, please visit https://ncalc.codeplex.com/
          • Name = “{description name of the formula}”
          • ActionType (FormulaActionType class) = {0 or 1}
            • SetFieldValue = 0, CalculateValue = 1
          • Expression = “{supports conditionals, math operators, comparisons, CRM schema-name as variables}”
          • OutputCrmField (CrmField class)
            • CrmFieldType = "{CrmField.CrmType.(Value)}"
            • Name = “{Dynamics CRM field schema name}”
            • Value = “{appropriate (optionset, dollar amount, integer value, other) output value}”
          • FailOnMissingField = {true or false}
          • Entity (Entity class) -> optional; CRM entity used to retrieve value of the fields from
          • PreEntity (Entity class) -> optional; CRM pre-event entity containing field values prior to change
        • Relationship (Relationship class)
          • ForeignKeyName = “{parent CRM field schema name}”
        • FieldValidators (FieldValidator List) -> a List of Validator rules for the plugin operation to follow
          • Range (FieldRange class) -> Validation boundary fields. Can be static, with values defined in config, or dynamic, with values retrieved from target record during execution
            • RangeValidationType = “{MinValue, MaxValue, EqualsValue, RangeValidationKind}”
              • Range = 0, Min = 1, Max = 2, Equals
          • Action (ValidatorAction class)
            • ActionType (ValidatorActionType class) = ValidatorAction.ValidatorActionType.(Value)
              • ValidatorActionType Values
                • SetField = 0, CreateTask = 1, SendEmail = 2, FieldAndTask = 3, FieldAndEmail = 4, FieldAndTaskAndEmail = 5
            • ActionKind = “{ValidatorActionType}”
            • ActionField -> object describing CRM field attributes
              • CrmFieldType = "{CrmField.CrmType.(Value)}"
              • Name = “{Dynamics CRM field schema name}”
              • Value = “{appropriate (optionset, dollar amount, integer value, other) output value}”
            • EntityLogicalName = “{Logical name of the CRM Entity to modify on invalid action}”
            • ValidatedFieldName = “{CRM schema name of the field to validate}”
          • ThrowExceptionWhenInvalid -> set to true to throw run-time exception if field is out of range. Used to stop current operation if needed
          • ValidatedFieldIsInRelatedRecord -> If false, we validate a field of the current entity. If true, a field in related entity
          • AdditionalErrorMessage = “{displays this string}”
          • Name = “{description of range}”
        • FilterFetchXml = “{Valid FetchXml fragment listing additional static filtering conditions for selected a subset of Source records}”
        • RollupOperation (RollupOperation class) -> Applicable math operation that can be executed on a set of Source fields prior to applying to Target field
          • Operation (Operations class) = “{Sum, Average, Min, Max, Count, Copy, or NoOp}”
            • Sum = 0, Average = 1, Min = 2, Max = 3, Count = 4, Copy = 5, NoOp = 99
          • OperationTyp] = “{Operation}”
          • FieldValidators -> list of field-level validation rules
        • TrackedFieldNames -> field names in CRM to track
      • TargetSetting -> target CRM entity for plugin operation; Description of the target data: parent entity and rollup field in this entity
        • EntityName = “{Dynamics CRM entity schema name}”
        • RollupFieldName = “{Dynamics CRM field schema name}”
        • PrimaryKeyName = “{primary key (schema name) of target entity}”

List of enum values

CrmType
public enum CrmType
{
CrmDouble = 0,
CrmDecimal = 1,
CrmInt = 2,
CrmMoney = 3,
CrmEntityReference = 4,
CrmString = 5,
CrmOptionset = 6,
CrmBoolean = 7
}


FormulaActionType
public enum FormulaActionType
{
SetFieldValue = 0,  // Used to set a value of the field referenced by FieldName
CalculateValue = 1  // Used to calculate an expression value
}


Operations
public enum Operations
{
Sum = 0,
Average = 1,
Min = 2,
Max = 3,
Count = 4,
Copy = 5,
NoOp = 99
}


RangeValidationType
public enum RangeValidationType
{
Range = 0,
Min = 1,
Max = 2,
Equals
}


ValidatorActionType
public enum ValidatorActionType
{
SetField = 0,
CreateTask = 1,
SendEmail = 2,
FieldAndTask = 3,
FieldAndEmail = 4,
FieldAndTaskAndEmail = 5
}

Last edited Oct 2, 2014 at 7:40 PM by DmitriR, version 16