CRM 2011: Create a Solution for a specific Publisher using C#

Hi there!!

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

public static Guid CreateSolution(IOrganizationService OrgService, string FriendlyName, string UniqueName, Guid PublisherId)
{
    Entity solution = new Entity("solution");
    solution["friendlyname"] = FriendlyName;
    solution["uniquename"] = UniqueName;
    solution["publisherid"] = new EntityReference("publisher", PublisherId);

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

You just want to connect to the CRM 2011 system and pass IOrganizationService object to the method and other required information related to Solution along with the PublisherId.

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