The solution offers two global actions, one to allow updating an entity without knowing its type a priori. The other allows updating the children of an entity whose type is not known a priori, starting with the name of the relationship.
The idea came from the need to perform updates on entity and/or children (link-entity) following a cloning operation done with the D365 Configurable Entity Cloner solution. In these scenarios, the type of the entity and children is not known a priori. So to avoid writing dedicated components for each scenario, I tried to develop generic components to perform field updates, in a configurable and entity type-independent manner.
- Update attributes on entity of any type.
- Update attributes on link-entity (children) of any type.
Dynamics 365 v9.2+
Build the project and deploy the assembly into your environment.
Integrate the action Update Generic Entity where you want to trigger it (Workflow, Javascript function, etc.).
-
RecordInfo:
- "RecordId" as string
- example D06F15DB-EEA5-4086-996B-47987DDB7628
- "RecordUrl" (string)
- example: https://myorg.crm.dynamics.com/main.aspx?etn=account&pagetype=entityrecord&id=%7B91330924-802A-4B0D-A900-34FD9D790829%7D
- "RecordId" as string
-
EntityName: schema-name of the entity
- required only when RecordInfo is a (string)RecordId
- example: account
-
UpdateInactive
- false -> the entity is updated only if it is in an active state
- true -> the entity is updated whatever its state is (active/inactive)
-
AttributesNameValue: a string containing a sequence of Attribute-Name/Attribute-Value
- format: jdm_field1=>val1<>jdm_field2=>val2<>jdm_field3=>val3...
- <> is a separator for the different Attribute-Name/Attribute-Value pair
- the value for the attributes is a normal string: it is parsed by the module to the proper attribute-type
- to set a null value for an attribute, simply provide and "empty value":
- example: jdm_field1=><>jdm_field2=><>jdm_field3=>val3
- format: jdm_field1=>val1<>jdm_field2=>val2<>jdm_field3=>val3...
Updates attributes on link-entities.
Integrate the action Update Entity Children where you want to trigger it (Workflow, Javascript function, etc.).
-
RecordInfo:
- "RecordId" as string
- example: D06F15DB-EEA5-4086-996B-47987DDB7628
- "RecordUrl" (string)
- example: https://myorg.crm.dynamics.com/main.aspx?etn=account&pagetype=entityrecord&id=%7B91330924-802A-4B0D-A900-34FD9D790829%7D
- "RecordId" as string
-
RelationshipName: schema-name of the relationship
- required
- example: contact_customer_accounts
-
UpdateInactive
- false -> the link-entity is updated only if it is in an active state
- true -> the link-entity is updated whatever its state is (active/inactive)
-
AttributesNameValue: a string containing a sequence of Attribute-Name/Attribute-Value
- format: jdm_field1=>val1<>jdm_field2=>val2<>jdm_field3=>val3...
- <> is a separator for the different Attribute-Name/Attribute-Value pair.
- the value for the attributes is a normal string: it is parsed by the module to the proper attribute-type
- to set a null value for an attribute, simply provide and "empty value":
- example: jdm_field1=><>jdm_field2=><>jdm_field3=>val3
- format: jdm_field1=>val1<>jdm_field2=>val2<>jdm_field3=>val3...
Thanks to all who helped inspire this solution.
This project is licensed under the GPLv3.