/// <summary>
        /// Sets the status for any entity
        /// </summary>
        /// <param name="entityReference">The entity ref that will change status</param>
        /// <param name="state">New state</param>
        /// <param name="status">New status</param>
        protected void SetStatusAndState(EntityReference entityReference, int state, int status)
        {
            SetStateRequest request = new SetStateRequest
            {
                State         = new OptionSetValue((int)state),
                Status        = new OptionSetValue((int)status),
                EntityMoniker = entityReference
            };

            OrganisationService.Execute(request);
        }
Пример #2
0
        /// <summary>
        /// Deactivates a defra_applicationtask record
        /// </summary>
        /// <param name="applicationTaskIdGuid">defra_applicationtask id</param>
        public void DeactivateApplicationTask(Guid applicationTaskIdGuid)
        {
            TracingService.Trace($"GetApplicationTaskIdsLinkedToApplication({applicationTaskIdGuid})");

            var state = new SetStateRequest
            {
                State         = new OptionSetValue((int)defra_applicationtaskState.Inactive),
                Status        = new OptionSetValue((int)defra_applicationtask_StatusCode.Inactive),
                EntityMoniker = new EntityReference(defra_applicationtask.EntityLogicalName, applicationTaskIdGuid)
            };

            OrganisationService.Execute(state);
        }