Доброго времени суток! Возникла следующая проблема:
В бизнес-процессе есть запрос:
EntitySchemaQuery CountOfOrderesq = new EntitySchemaQuery(UserConnection.EntitySchemaManager,"UsrOrderProvidersProduct");
CountOfOrderesq.IsDistinct = true;
CountOfOrderesq.AddAllSchemaColumns();
CountOfOrderesq.Filters.Add(CountOfOrderesq.CreateFilterWithParameters(FilterComparisonType.Equal, "UsrOrderId", OrderId));
CountOfOrderesq.Filters.Add(CountOfOrderesq.CreateFilterWithParameters(FilterComparisonType.Greater, "UsrShipped", 0));
var CountOfOrders = CountOfOrderesq.GetEntityCollection(UserConnection);
Далее его результат вызывается в цикле
foreach (var Order in CountOfOrders){
EntitySchema Activityschema = UserConnection.EntitySchemaManager.GetInstanceByName("Activity");
var OrderNumber = Order.GetTypedColumnValuestring>("UsrClientsOrderId.Number");//вот здесь
var ClientsOrder = Order.GetTypedColumnValueGuid>("UsrClientsOrderId");
var ActivityEntity = Activityschema.CreateEntity(UserConnection);
ActivityEntity.SetDefColumnValues();
ActivityEntity.SetColumnValue("Title", "Повторная комплектация по заказу клиента " + OrderNumber);
ActivityEntity.SetColumnValue("UsrComplicateAftProvidersOrder", true);
ActivityEntity.SetColumnValue("TypeId", "ad9476d6-cec0-4c69-b361-c80db1670fb5");//тип комплектация
ActivityEntity.SetColumnValue("OrderId", ClientsOrder);
ActivityEntity.Save();
ActivityEntities.Add(ActivityEntity);
}
При выполнении появляется ошибка:
Terrasoft.Common.ItemNotFoundException: Значение с именем "UsrClientsOrderId.Number" не найдено
в Terrasoft.Core.Entities.EntityColumnValueCollection.GetByName(String name)
в Terrasoft.Core.Entities.Entity.InternalGetColumnValue(String valueName)
в Terrasoft.Core.Entities.Entity.GetTypedColumnValue[TResult](String valueName)
в Terrasoft.Core.Process.UsrProcess1.ScriptTask1Execute(ProcessExecutingContext context)
в Terrasoft.Core.Process.ProcessFlowElement.Execute(ProcessExecutingContext context)
Sql-текст запроса:
SELECT DISTINCT
[UsrOrderProvidersProduct].[Id] [Id],
[UsrOrderProvidersProduct].[CreatedOn] [CreatedOn],
[UsrOrderProvidersProduct].[CreatedById] [CreatedById],
[CreatedBy].[Name] [CreatedBy.Name],
[CreatedBy].[PhotoId] [CreatedBy.PhotoId],
[UsrOrderProvidersProduct].[ModifiedOn] [ModifiedOn],
[UsrOrderProvidersProduct].[ModifiedById] [ModifiedById],
[ModifiedBy].[Name] [ModifiedBy.Name],
[ModifiedBy].[PhotoId] [ModifiedBy.PhotoId],
[UsrOrderProvidersProduct].[ProcessListeners] [ProcessListeners],
[UsrOrderProvidersProduct].[UsrProductId] [UsrProductId],
[UsrProduct].[Name] [UsrProduct.Name],
[UsrProduct].[PictureId] [UsrProduct.PictureId],
[UsrOrderProvidersProduct].[UsrQuantity] [UsrQuantity],
[UsrOrderProvidersProduct].[UsrUnitId] [UsrUnitId],
[UsrUnit].[Name] [UsrUnit.Name],
[UsrOrderProvidersProduct].[UsrOrderIdId] [UsrOrderIdId],
[UsrOrderId].[Number] [UsrOrderId.Number],
[UsrOrderProvidersProduct].[UsrCompleted] [UsrCompleted],
[UsrOrderProvidersProduct].[UsrShipped] [UsrShipped],
[UsrOrderProvidersProduct].[UsrClientsOrderIdId] [UsrClientsOrderIdId],
[UsrClientsOrderId].[Number] [UsrClientsOrderId.Number],
[UsrOrderProvidersProduct].[UsrMust] [UsrMust],
[UsrOrderProvidersProduct].[UsrProcessed] [UsrProcessed],
[UsrOrderProvidersProduct].[UsrTotalAmountWithoutVAT] [UsrTotalAmountWithoutVAT]
FROM [dbo].[UsrOrderProvidersProduct] [UsrOrderProvidersProduct]
WITH(NOLOCK) LEFT OUTER JOIN [dbo].[Contact] [CreatedBy]
WITH(NOLOCK) ON ([CreatedBy].[Id] = [UsrOrderProvidersProduct].[CreatedById]) LEFT OUTER JOIN [dbo].[Contact] [ModifiedBy]
WITH(NOLOCK) ON ([ModifiedBy].[Id] = [UsrOrderProvidersProduct].[ModifiedById]) LEFT OUTER JOIN [dbo].[Product] [UsrProduct]
WITH(NOLOCK) ON ([UsrProduct].[Id] = [UsrOrderProvidersProduct].[UsrProductId]) LEFT OUTER JOIN [dbo].[Unit] [UsrUnit]
WITH(NOLOCK) ON ([UsrUnit].[Id] = [UsrOrderProvidersProduct].[UsrUnitId]) LEFT OUTER JOIN [dbo].[ORDER] [UsrOrderId]
WITH(NOLOCK) ON ([UsrOrderId].[Id] = [UsrOrderProvidersProduct].[UsrOrderIdId]) LEFT OUTER JOIN [dbo].[ORDER] [UsrClientsOrderId]
WITH(NOLOCK) ON ([UsrClientsOrderId].[Id] = [UsrOrderProvidersProduct].[UsrClientsOrderIdId])
WHERE [UsrOrderProvidersProduct].[UsrOrderIdId] = @P1 AND [UsrOrderProvidersProduct].[UsrShipped] > @P2
Подскажите пожалуйста решение проблемы. Заранее спасибо!