cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

how to convert model to relationmodelowner

Ketan_Lalcheta
19-Tanzanite

how to convert model to relationmodelowner

Hi

 

I have model object and want to convert it to relation owner object for weblink. How to get the same?

1 REPLY 1
sjuraj
13-Aquamarine
(To:Ketan_Lalcheta)

Model is already RealtionOwner because Model extends RelationOwner .. I have not used weblink but in Jlink I would do this:

 

Model model = session.GetCurrentModel();

RelationOwner relOwner = (RelationOwner) model; //casting model to relation owner, but I suppose you do not have to cast it in javascript because it is dynamically typed language so it will automatically handle inheritence

 

However I do not have to cast it in Jlink because it already have RelationOwner methods so both of theese is valid:

model.GetRelations();

relOwner.GetRelations();

Top Tags