xrm-ci-framework icon indicating copy to clipboard operation
xrm-ci-framework copied to clipboard

MSCRM Export Solution Task gives: Unrecognized request parameter: ExportExternalApplications

Open matthew-yee opened this issue 4 years ago • 4 comments

firstly, Love this tool

Secondly, we have run into the same issue as https://github.com/WaelHamze/xrm-ci-framework/issues/6 while wroking with good old crm 2015

The fix i'm hoping is a simple one. The comments indicate sdk backwards compatibility issue, however, this may not be quite the case.

The actual "ExportSolutionRequest" message is set up in a way where if the property never gets "set", it will never get included in the request (the backing of fields on the message this is actually a array or key value pair (on the org base message) - sorry not sure if i explain this as well but reflector will show this better.... (guessing it'll be described as lazy setting of a property?)

The fix i believe is (assuming you choose to still support crm2015 where possible - which will def help me out ;-) )

In the solutionmanager.cs and ExportXrmSolutionCommand.cs, only set the contentious properties when needed (when passed in as true) rather then object initializer,

Ie:

            var exportSolutionRequest = new ExportSolutionRequest
            {
                Managed = options.Managed,
                SolutionName = options.SolutionName,
                ExportAutoNumberingSettings = options.ExportAutoNumberingSettings,
                ExportCalendarSettings = options.ExportCalendarSettings,
                ExportCustomizationSettings = options.ExportCustomizationSettings,
                ExportEmailTrackingSettings = options.ExportEmailTrackingSettings,
                ExportGeneralSettings = options.ExportGeneralSettings,
                ExportIsvConfig = options.ExportIsvConfig,
                ExportMarketingSettings = options.ExportMarketingSettings,
                ExportOutlookSynchronizationSettings = options.ExportOutlookSynchronizationSettings,
                ExportRelationshipRoles = options.ExportRelationshipRoles,
                ExportSales = options.ExportSales,
                TargetVersion = options.TargetVersion,
              
            };

            if (options.ExportExternalApplications)
                exportSolutionRequest.ExportExternalApplications = options.ExportExternalApplications;

Hopefully useful for anyone else with this issue but also hopefully it gets included in future releases (saves me from maintaining my own 2015 branch)

matthew-yee avatar May 22 '20 03:05 matthew-yee

Solutionmanager.cs -> import solution is also the same with the field Holding Solution

       var importSolutionRequest = new ImportSolutionRequest
            {
                CustomizationFile = solutionBytes,
                PublishWorkflows = publishWorkflows,
                ConvertToManaged = convertToManaged,
                OverwriteUnmanagedCustomizations = overwriteUnmanagedCustomizations,
                SkipProductUpdateDependencies = skipProductUpdateDependencies,
                ImportJobId = importJobId.Value,
                RequestId = importJobId,
            };

            if (holdingSolution)
                importSolutionRequest.HoldingSolution = holdingSolution;

I can do a PR if you think this is something useful

matthew-yee avatar May 23 '20 13:05 matthew-yee

@matthew-yee I believe there is a version for 2015 in this repo but it is not updated.

If you raise a PR I can include this in next release.

Great Idea!

WaelHamze avatar May 26 '20 06:05 WaelHamze

@matthew-yee let me know if you interested in testing this feature in the preview extension

WaelHamze avatar Jul 15 '20 19:07 WaelHamze

@WaelHamze sorry for the late reply, Yep i can commit a bit of time in the coming week. would the preview be via devops task (or something i should install etc?)

thanks

matthew-yee avatar Jul 19 '20 01:07 matthew-yee