Привет,
есть тривиальная задача, создавать в форкфлоу оред и ид-шник прокидывать через екшен на клиент, чтобы с помощью 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