Project Metadata

Posts   
 
    
DarkRoast
User
Posts: 42
Joined: 14-Jul-2010
# Posted on: 30-Nov-2010 04:56:48   

Hi all,

I'm trying to access relationship information via the Relations object on an entity.

However, properties such as AliasFKSide, AliasPKSide, or AliasStartEntity are not populated. Just curious why this wouldn't be populated. It seems like the information is available in the Project file.

At the moment I've gotten to the information via an Xpath query against the project's xml.

The xpath is something like this:

/Project/EntityModel/Relationships/NormalRelationship[@Start=':{0}']/FieldRelationships/FieldFieldRelationship[@FkField='{1}']

I found this thread: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=5394 but I'm hoping to avoid modifying or including templates

Is there an easier way to get the names/fields of related entities?

Also, is there a way to determine if an entity is mapped to view vs a table at runtime? It looks like that information could also be queried from the project file if necessary.

Thanks for any info.

(I'm using the latest build of v3.0, SelfServicing)

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 30-Nov-2010 10:16:42   

I found this thread: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=5394 but I'm hoping to avoid modifying or including templates

Is there an easier way to get the names/fields of related entities?

I'm afraid not. That's the only way around this.

DarkRoast
User
Posts: 42
Joined: 14-Jul-2010
# Posted on: 30-Nov-2010 17:43:38   

Walaa wrote:

I'm afraid not. That's the only way around this.

Fair enough. Is there a downside to querying the project file for this information?

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 30-Nov-2010 21:07:34   

Not that I can think of off the top of my head.

Matt

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 01-Dec-2010 10:47:30   

At runtime, you need to consult the project file. In the designer, you can use element search instead.

Frans Bouma | Lead developer LLBLGen Pro