private Entity RetrieveSolution(ConnectionDetail currentDetail) { if (currentDetail.SolutionId == null) { return(null); } WebRequest.GetSystemWebProxy(); var service = CrmConnectionHelper.GetOrganizationServiceProxy(currentDetail); QueryExpression query = new QueryExpression { EntityName = "solution", ColumnSet = new ColumnSet(new string[] { "friendlyname", "uniquename", "publisherid" }), Criteria = new FilterExpression() }; query.Criteria.AddCondition("isvisible", ConditionOperator.Equal, true); query.Criteria.AddCondition("solutionid", ConditionOperator.Equal, currentDetail.SolutionId); query.LinkEntities.Add(new LinkEntity("solution", "publisher", "publisherid", "publisherid", JoinOperator.Inner)); query.LinkEntities[0].Columns.AddColumns("customizationprefix"); query.LinkEntities[0].EntityAlias = "publisher"; var response = service.RetrieveMultiple(query); return(response.Entities.FirstOrDefault()); }
/* * /// <summary> * /// Publisher constructor * /// </summary> * /// <param name="connection">Connection to CRM that will be used to upload webresources</param> * /// <param name="project">Project to upload files from</param> * /// <param name="autoPublish">Perform publishing or not</param> * /// <param name="ignoreExtensions">Try to upload without extension if item not found with it</param> * /// <param name="extendedLog">Print extended uploading process information</param> * public Publisher(ConnectionDetail connection, Project project, bool autoPublish, bool ignoreExtensions, bool extendedLog = false): this(connection, autoPublish, ignoreExtensions, extendedLog) * { * if(project == null) * { * throw new ArgumentNullException("project"); * } * _project = project; * _projectRootPath = Path.GetDirectoryName(_project.FullName); * } */ /// <summary> /// Publisher constructor /// </summary> /// <param name="connection">Connection to CRM that will be used to upload webresources</param> /// <param name="autoPublish">Perform publishing or not</param> /// <param name="ignoreExtensions">Try to upload without extension if item not found with it</param> /// <param name="extendedLog">Print extended uploading process information</param> private Publisher(ConnectionDetail connection, bool autoPublish, bool ignoreExtensions, bool extendedLog) { _connectionDetail = connection ?? throw new ArgumentNullException(nameof(connection)); _autoPublish = autoPublish; _ignoreExtensions = ignoreExtensions; _extendedLog = extendedLog; _orgService = CrmConnectionHelper.GetOrganizationServiceProxy(_connectionDetail); }
public CreateWebResourceForm(string filePath) { var settings = ProjectHelper.GetSettings(); _connectionDetail = settings.SelectedConnection; if (_connectionDetail.SolutionId == null) { throw new ArgumentNullException("SolutionId"); } WebRequest.GetSystemWebProxy(); _service = CrmConnectionHelper.GetOrganizationServiceProxy(_connectionDetail); ProjectItemPath = filePath; InitializeComponent(); }