Fields on Related Fields

Posts   
 
    
usschad
User
Posts: 77
Joined: 11-Sep-2008
# Posted on: 28-Feb-2013 16:59:06   

I read the section on Fields on Related Fields: http://www.llblgen.com/documentation/3.1/Designer/Functionality%20Reference/EntityEditor_FieldsTab.htm

However, I'm not completely certain on how to use them. I'd assume that these fields just get populated when you do a fetch entity, these fields automatically are fetched from the related entity.

I added some fields, but they aren't getting filled.

How do I do that? Am I missing something, or am I misunderstanding the usage of this feature?

LLBLGen 3.0 (January 3rd 2011) Adapter SQL Server 2008 R2

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 28-Feb-2013 18:17:07   

Fields on related fields, don't get populated when fetching the main entity. They will be populated when the related entity get fetched.

What they are used for? This gives you the ability to create a property on an entity, that get's it value from another property/field on a related entity, might be useful when databinding, if you don't want to access related entities at databinding.

So don't use them unless there is a need for them.

usschad
User
Posts: 77
Joined: 11-Sep-2008
# Posted on: 28-Feb-2013 22:21:30   

Ah! I think I get it. So you still have to do the prefetch... and the field is just a property that accesses the field in the child entity?

If so, that makes sense and yes, it would work well in my case of data binding for display purposes.

Thanks.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 01-Mar-2013 00:13:54   

usschad wrote:

Ah! I think I get it. So you still have to do the prefetch... and the field is just a property that accesses the field in the child entity?

Exactly. You need to populate the related entity with a prefetchPath when you fetch the main entity.

usschad wrote:

If so, that makes sense and yes, it would work well in my case of data binding for display purposes.

Yep simple_smile

David Elizondo | LLBLGen Support Team