private void ExecuteCrmAddresses(LocalPluginContext context) { // Account is used here, but since all Entities have the same exact field names, this works just fine var target = context.GetTarget<Entity>(); switch (target.LogicalName) { case Contact.EntityLogicalName: RemoveFormatting(target, Contact.Fields.Address3_Telephone1); RemoveFormatting(target, Contact.Fields.Address3_Telephone2); RemoveFormatting(target, Contact.Fields.Address3_Telephone3); RemoveFormatting(target, Contact.Fields.MobilePhone); break; case Lead.EntityLogicalName: case SystemUser.EntityLogicalName: RemoveFormatting(target, Contact.Fields.MobilePhone); break; } RemoveFormatting(target, Account.Fields.Address1_Telephone1); RemoveFormatting(target, Account.Fields.Address1_Telephone2); RemoveFormatting(target, Account.Fields.Address1_Telephone3); RemoveFormatting(target, Account.Fields.Address2_Telephone1); RemoveFormatting(target, Account.Fields.Address2_Telephone2); RemoveFormatting(target, Account.Fields.Address2_Telephone3); }
private void ExecuteCrmPhoneNumber(LocalPluginContext context) { // Account is used here, but since all Entities have the same exact field names, this works just fine var target = context.GetTarget<Entity>(); RemoveFormatting(target, Account.Fields.Telephone1); RemoveFormatting(target, Account.Fields.Telephone2); RemoveFormatting(target, Account.Fields.Telephone3); ExecuteCrmAddresses(context); }
protected override void ExecuteInternal(LocalPluginContext context) { throw new InvalidOperationException("Should Never Get Called!"); }