Quantcast
Channel: Microsoft Dynamics CRM
Viewing all articles
Browse latest Browse all 71679

Forum Post: RE: Creating a Plugin to Retrieve Surname, Firstname, Middlename & Store in Custom Fields

$
0
0
Hi, You can also use this plugin on Update message , after checking it's MessageName. if (context.MessageName == "Create") { //Create code goes here } if (context.MessageName == "Update") { //Update code goes here string lastnameValue = contact.Contains("lastname") ? contact.GetAttributeValue ("lastname") : string.Empty; string firstnameValue = contact.Contains("firstname") ? contact.GetAttributeValue ("firstname") : string.Empty; string midddlenameValue = contact.Contains("middlename") ? contact.GetAttributeValue ("middlename") : string.Empty; contact.Attributes["new_fullnamesfm"] = lastnameValue + " " + firstnameValue + " " + midddlenameValue; contact.Attributes["new_fullnamesmf"] = lastnameValue + " " + midddlenameValue + " " + firstnameValue; } Thanks

Viewing all articles
Browse latest Browse all 71679

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>