Showing posts with label Development. Show all posts
Showing posts with label Development. Show all posts

Plugin to set records' names automatically

On each projects there are entities we can't force user to set names for (because it is needless). However it is good approach if all you records has names, especially if you have to choose these records in lookups.

I use plugins to set names of such entities. To simplify development of such plugins I did a base class and want to share it with you.

Let me show you example of the plugin which is based on SetNamePluginBase (base plugin) I share below.

using ExitoConsulting.Plugins.Base;
using Microsoft.Xrm.Sdk;

namespace ExitoConsulting.Plugins
{
    public class OwnerSetName : SetNamePluginBase
    {
        protected override string GetName(Entity entity, IPluginExecutionContext context, IOrganizationService service)
        {
            var fullName = entity.GetAttributeValue("ec_fullname");
            var clientId = entity.GetAttributeValue("ec_clientid");

            if(string.IsNullOrEmpty(fullName))
            {
                return null;
            }

            var name = fullName;
            if(!string.IsNullOrEmpty(clientId))
            {
                name = name + string.Format(" - {0}", clientId);
            }

            return name;
        }
    }
}

Introducing Visual Studio Add-On "Microsoft Dynamics CRM Web Resources Updater"

This add-on will be useful for each Microsoft Dynamics CRM Developer. It allows to initiate upload and publish process directly from Visul Studio. The main benefit is that web resources upload and publish process takes as little time as possible because add-on is only take care about web resources that are changed. It will help to speed up development and debugging processes by allowing you to focus on the code you are crating.

See full description here: http://happycrm.blogspot.ru/p/crm-publisher.html

If you have any issue or comment just write me in comments or you can also leave a feedback on Codeplex or Visual Stuio Gallery and I will fix it shortly.

Hope you will love this add-on.