locked
List all the solution components RRS feed

  • Question

  • Hi,

    I need to get a list of solution components programmatically.

    Is there a class similar to RetrieveRequiredComponentsRequest to retrieve a collection of the solution components?

    Thank you

    Tuesday, January 24, 2012 11:06 PM

Answers

  • hi,

    please refer CRM 2011 SDK and search for Sample: Detect Solution Dependencies, you will get the full sample code.

    // Grab all Solution Components for a solution.
                        QueryByAttribute componentQuery = new QueryByAttribute
                        {
                            EntityName = SolutionComponent.EntityLogicalName,
                            ColumnSet = new ColumnSet("componenttype", "objectid", "solutioncomponentid", "solutionid"),
                            Attributes = { "solutionid" },
    
                            // In your code, this value would probably come from another query.
                            Values = { _primarySolutionId }
                        };
    
    



    Thomas T(MCBMSS) If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    • Proposed as answer by Thomas Thankachan Wednesday, January 25, 2012 12:56 AM
    • Marked as answer by firefeeder Thursday, January 26, 2012 8:00 PM
    Wednesday, January 25, 2012 12:55 AM

All replies

  • hi,

    please refer CRM 2011 SDK and search for Sample: Detect Solution Dependencies, you will get the full sample code.

    // Grab all Solution Components for a solution.
                        QueryByAttribute componentQuery = new QueryByAttribute
                        {
                            EntityName = SolutionComponent.EntityLogicalName,
                            ColumnSet = new ColumnSet("componenttype", "objectid", "solutioncomponentid", "solutionid"),
                            Attributes = { "solutionid" },
    
                            // In your code, this value would probably come from another query.
                            Values = { _primarySolutionId }
                        };
    
    



    Thomas T(MCBMSS) If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    • Proposed as answer by Thomas Thankachan Wednesday, January 25, 2012 12:56 AM
    • Marked as answer by firefeeder Thursday, January 26, 2012 8:00 PM
    Wednesday, January 25, 2012 12:55 AM
  • That is what I was looking for.

    Thank you very much!

    Thursday, January 26, 2012 8:01 PM