How can I Update fullname in COntact in CRM

2019-08-01 07:16发布

I want format of fullname like Title + First Name + Last Name.but this type of format is not avalilable in System settings.so,I just want to update fullname not first name or last name.How can I achieve this requirements.

2条回答
forever°为你锁心
2楼-- · 2019-08-01 07:29

I don't know if i understand what you want archive in settings i don't know any way, if have some solutions: plugin, workflow or javascript. You can add in onchange event of firstname, fullname and title and change fullname. Something like that:

Xrm.Page.getAttribute("fullname").setValue(Xrm.Page.getAttribute("firstname").getValue() + Xrm.Page.getAttribute("lastname").getValue());

EDIT: I forgotten that is readonly you can change readonly using Javascript like that:

Xrm.Page.getAttribute("fullname").setSubmitMode("always");

See here another option.

查看更多
做个烂人
3楼-- · 2019-08-01 07:38

The answer is you can't change the format of full name in the database aside from the formats CRM defines as options. But, you do have two options:

  1. Create a Select plugin that updates the value of the full name on the entity (if you're using early bound, the property will still be read-only, but you can edit the value in the attributes collection directly with no issues.) This could potentially be a really bad performance issue since selecting 1000 entities requires the plugin to run a 1000 times. I'd probably recommend the next option:

  2. Create your own field new_fullname. And make the format whatever you want. Setting it with a Create/update plugin, as well as potentially through the JavaScript. Then it's just updating your forms, views, and any plugins / workflows that currently reference fullname.

查看更多
登录 后发表回答