Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get data in Row.cs from third table #3942

Closed
ga5tan opened this issue Sep 22, 2018 · 3 comments
Closed

Get data in Row.cs from third table #3942

ga5tan opened this issue Sep 22, 2018 · 3 comments

Comments

@ga5tan
Copy link

ga5tan commented Sep 22, 2018

It is possible to lookup data in row from Left Join table like this:
[DisplayName("Registrant ID"), Column("RegistrantID"), NotNull, ForeignKey(typeof(UsersRow)), LeftJoin("jRegistrant")]

but I need to make left join on left joined column, ie add third table, which entity is referenced in second (leftJoined) table.

any idea if that's possible?

@JohnRanger
Copy link

JohnRanger commented Sep 23, 2018

Hi @ga5tan ,

just try it. In your case it would be on the UserId foreign field within the xyzRow (the row where your [DisplayName("Registrant ID")...] declaration is).

Just do again the foreignKey(typeof(<your3rdTable>)), LeftJoin("j<Your3rdTableNickname>");

I had done this long - long ago - and it had worked as I remember.

And then declare the 3rdTable's desired fields like you did for fields from the 2nd table but refer to j<Your3rdTableNickname> instead of the 2nd table's nickname.

With kind regards,

John

@ga5tan
Copy link
Author

ga5tan commented Sep 24, 2018

thx @JohnRanger , it worked.
for some reason I had to specify source column in Origin tag as well, but it works!
this is second LeftJoin on already joined field:

[DisplayName("Code"), Origin("jRegistrant"), Expression("jRegistrant.[LoginId]"), ForeignKey(typeof(Respondents.Entities.UserLoginRow)), LeftJoin("jRespondent"), MinSelectLevel(SelectLevel.List)]

this is from third table:

[DisplayName("Code"), Origin("jRespondent","Username"), Expression("jRespondent.[Username]"), MinSelectLevel(SelectLevel.List)]

@ga5tan ga5tan closed this as completed Sep 24, 2018
@antoniojp
Copy link

I have the same problem. Could you post the complete Row file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants