Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Unanswered

Error when exporting the entity: Invalid relation between entities

(0) ShareShare
ReportReport
Posted on by 465

Hi,

I created this composite entity
pastedimage1676551514125v1.png

Table1Entity has a View called Table1LogView inner joined with Table1(Relation Table1LogView.JournalId= Table1.JournalId)

EntityKey is JournalId coming from the view

Table1LogView  is like this:

SELECT        MAX(RECID) AS TABLE1LOGVIEWRECID, JOURNALID, STATUS, DATAAREAID, PARTITION, 1010 AS RECID
FROM            dbo.TABLE1LOG AS T1
WHERE        (STATUS = 0)
GROUP BY JOURNALID, STATUS, DATAAREAID, PARTITION


Table1 contains this
Id  JournalId  JournalParmId  JournalType
1     J1           1A             10
1     J2           2B             15
1     J3           2B             0
1     J4           4C             15
1     J5           4C             15
1     J6           4C             15


Table1LogView Contains this  (hence J2 is not appearing)
Id  JournalId      Staus
1     J1           0            
1     J3           0            
1     J4           0             
1     J5           0             
1     J6           0



LinkedTable1Entity  has View called LinkedTable1View inner joined with Table1    (Relation LinkedTable1View.ViewRecId= Table1.RecId)

EntityKey
is JournalId coming from Table1

The view is like this

SELECT        MIN(RECID) AS VIEWRECID, JOURNALPARMID, ID, DATAAREAID, PARTITION, 1010 AS RECID
FROM            dbo.TABLE1 AS T1
WHERE        (POSTED = 1)
GROUP BY JOURNALPARMID, ID, DATAAREAID, PARTITION
HAVING        (COUNT(RECID) = 2)



Relation between LinkedTable1Entity  and Table1Entity is:

LinkedTable1Entity.Id = Table1Entity.Id
AND 
LinkedTable1Entity.JournalParmId= Table1Entity .JournalParmId

However, I'm getting this error when exporting:
Invalid relation between entities


If i do this:

 

select ID,JOURNALID,JOURNALPARMID,JOURNALTYPE From TABLE1ENTITY

I get this

Id  JournalId  JournalParmId  JournalType
1     J1           1A             10
1     J3           2B             0
1     J4           4C             15
1     J5           4C             15
1     J6           4C             15



select ID,JOURNALID,JOURNALPARMID,JOURNALTYPE From LinkedTABLE1ENTITY

I get this

Id  JournalId  JournalParmId  JournalType
1     J2           2B             15



Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,111 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,934 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans