I’ve created new fields in the “incident” entity and need those fields to be set by default according to some “account” fields when a an incident is created.
Of course mapping works fine but only when the incident is created from the account.
I’ve created a workflow, it works but it’s a bit too slow…
Is there a way to do it in JavaScript?
Thanks in advance !
You can use either javascript or a plugin to accomplish this.
Javascript: Edit the entity form and add your .js file under the Form Properties window.
In javascript you can use the Xrm.getAttributes(“fieldname).setValue(“my default”); (Google for correct syntax)
Plug-in: You’ll hook into the “Create” message for that entity. You’ll use the plugin registration tool that comes with the CRM SDK.
Picklist: If it’s a picklist you can use the “default value” check box in the attribute properties window of the entity.