Показать сообщение отдельно
Старый 11.01.2019, 18:39   #1  
Ion is offline
Ion
Участник
 
332 / 16 (1) ++
Регистрация: 19.12.2012
Code Activity OutPut Arguments
Привет,


есть тривиальная задача, создавать в форкфлоу оред и ид-шник прокидывать через екшен на клиент, чтобы с помощью js откыть новосозданную запись.

Вот код активности
X++:
     [Input("Quote")]
        [RequiredArgument]
        [ReferenceTarget("quote")]
        public InArgument<EntityReference> QuoteRef { get; set; }

        [Input("Products")]
        [RequiredArgument]
        [ReferenceTarget("products")]
        public InArgument<string> ProductIds { get; set; }

        [Output("CreatedOrderId")]
        [RequiredArgument]
        public OutArgument<string> CreatedOrderId { get; set; }


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

            EntityReference quoteRef = QuoteRef.Get<EntityReference>(executionContext);
            string productIds = ProductIds.Get<string>(executionContext);

            Guid createdOrderId = new OpportunityService(service).CreateOrder(quoteRef.Id, productIds);

            CreatedOrderId.Set(executionContext, createdOrderId.ToString());
        }


Хочу заюзать, но там постоянно null
X++:
function OpenOrder(orderId) {
	var windowOptions = {
		openInNewWindow: true
	};
	Xrm.Utility

Последний раз редактировалось Ion; 11.01.2019 в 19:17.