Personalized Community is here!
Quickly customize your community to find the content you seek.
Have questions on moving to the cloud? Visit the Dynamics 365 Migration Community today! Microsoft’s extensive network of Dynamics AX and Dynamics CRM experts can help.
2021 Release Wave 2Discover the latest updates and new features releasing from October 2021 through March 2022.
2021 release wave 2 plan
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Upcoming TechTalks | All TechTalks
Thought this would be super simple but I am running into some walls. Any help would be appreciated:
Thanks for taking the time to help me resolve this issue. Any thoughts would be helpful. So here goes:
You can register a plugin on pre-create and pre-update of contact record which extracts domain name from email address and set to another field in contact.
Below code is for your reference
public void Execute(IServiceProvider serviceProvider)
IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));
IOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);
if (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is Entity)
Entity entity = (Entity)context.InputParameters["Target"];
string emailAddress = entity.Contains("emailaddress1") ? entity.GetAttributeValue<string>("emailaddress1") : string.Empty;
MailAddress address = new MailAddress("email@example.com");
string host = address.Host;
entity.Attributes["new_emaildomain"] = host;
Business Applications communities