web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

SDK CRM - Connection Role and Solution

(0) ShareShare
ReportReport
Posted on by

I'm creating connection roles via C# as follows:

            // Create a Connection Role for contact
            ConnectionRole newCR_Patient = new ConnectionRole
            {
                Name = "Patient",
                Category = new OptionSetValue(Categories.Business)
            };

            _CRId_Patient = _serviceProxy.Create(newCR_Patient);
            Console.WriteLine("  Created {0}.", newCR_Patient.Name);

            // Create a related Connection Role Object Type Code record for Contact
            createCRObject_Contact(_serviceProxy, _CRId_Patient);

Is there a way to associate the connection role to a solution?  When I execute this code, the connection role is being created in the main customization of my project.  I'd like to create this role in a specific solution - similar to how an entity can be created within a Solution.  Any help, much appreciated.  


Thanks!

*This post is locked for comments

I have the same question (0)
  • Verified answer
    oachief Profile Picture
    on at

    I figured it out.   I had to use a CreateRequest method.  One of the parameters added to the CreateRequest is the SolutionUniqueName.

    // Create a Connection Role for contact

               ConnectionRole newCR_Patient = new ConnectionRole

               {

                   Name = "Patient",

                   Category = new OptionSetValue(Categories.Business)

               };

               // Create Request for role creation

               CreateRequest cr = new CreateRequest

               {

                   Target = newCR_Patient

               };

               cr.Parameters.Add("SolutionUniqueName", _SolutionName);

               CreateResponse cresp = (CreateResponse)_serviceProxy.Execute(cr);

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans