Показать сообщение отдельно
Старый 02.11.2016, 14:59   #13  
Ion is offline
Ion
Участник
 
332 / 16 (1) ++
Регистрация: 19.12.2012
Цитата:
Сообщение от a33ik Посмотреть сообщение
Скриншоты не помешают.
В новой сборке всего один аction, а в RT ничего нет

X++:
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Workflow;
using System;
using System.Activities;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EmployeeWorkflow.Actions
{
    public class ValidateChangeProcessStage : CodeActivity
    {
        [ReferenceTarget("contact")]
        public InArgument<EntityReference> ontact { get; set; }

        protected override void Execute(CodeActivityContext executionContext)
        {
            IWorkflowContext context = executionContext.GetExtension<IWorkflowContext>();
            IOrganizationServiceFactory serviceFactory = executionContext.GetExtension<IOrganizationServiceFactory>();
            IOrganizationService service = serviceFactory.CreateOrganizationService(null);

            EntityReference contact = ontact.Get<EntityReference>(executionContext);
            if (contact != null)
            {
                new InvalidPluginExecutionException("You can not change process flow stage manually");
            }
        }
    }
}