Hi,
I am trying to add a complex query as Sql statement in a Table definition.
Something like
select [Id], [EntityId], [EntityRelationId], [EntityAuthorizationId], [ContactId], [IsPrimary], [IsDeleted], [RowVersion],
[ContactDisplayName], [ContactSsn], [ContactTin], [ContactPhone1TypeName], [ContractPhone1Label], [ContactPhone1],
[ContactPhone2TypeName], [ContractPhone2Label], [ContactPhone2], [ContactPhone3TypeName], [ContractPhone3Label],
[ContactPhone3], [ContactEmail], [ContactAddressLine]
FROM [Entities].[EntityContact] ec
cross apply
(select top 1 ed.DisplayName as ContactDisplayName, ed.Ssn as ContactSsn, ed.Tin as ContactTin,
ed.Phone1TypeName as ContactPhone1TypeName, ed.Phone1Label as ContractPhone1Label,
ed.Phone1 as ContactPhone1,
ed.Phone2TypeName as ContactPhone2TypeName, ed.Phone2Label as ContractPhone2Label,
ed.Phone2 as ContactPhone2,
ed.Phone3TypeName as ContactPhone3TypeName, ed.Phone3Label as ContractPhone3Label,
ed.Phone3 as ContactPhone3, ed.Email as ContactEmail,
ed.AddressLine as ContactAddressLine
from Entities.vEntityData ed
where ed.Id = ec.Id
) ved
where {WHERE}
in this example i set [Entities].[EntityContact] as refresh table.
i also use a business processor and created commands for insert, update and delete.
in all cases i get either
“The multi-part identifier Entities.EntityContact.EntityId could not be bound” or
“one or more updates failed to apply on the server. -1: cant refresh delta, record isn’t found”
how can i have this kind of functionality, to have a complex sql as view model and have separate statements - commands for insert, update and delete. In all my attempts i get errors either on open or on internal refresh after apply updates.
Thanks
Yiannis