How can I Update fullname in COntact in CRM

做~自己de王妃 提交于 2019-12-11 12:40:21

问题


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.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/18183996/how-can-i-update-fullname-in-contact-in-crm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!