CRM 2011: Create a new Publisher using C#

Hello geeks!

When you have not created any proxy from the CRM service; and you want to create a new Publisher using C# code. You wanna check below code:

public static Guid CreatePublisher(IOrganizationService OrgService, string FriendlyName, string UniqueName, string CustomizationPrefix)
{
    Entity publisher = new Entity("publisher");
    publisher["friendlyname"] = FriendlyName;
    publisher["uniquename"] = UniqueName;
    publisher["customizationprefix"] = CustomizationPrefix;

    Guid ResultId = OrgService.Create(publisher);
    return ResultId;
}

Just connect to the CRM 2011 system and pass IOrganizationService object to the method and other required information related to Publisher.

Happy Programming!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s