Loading Specific Relation Record?

Find out how to get things done with Servoy. Post how YOU get things done with Servoy

Loading Specific Relation Record?

Postby john1598360627 » Fri Nov 22, 2024 12:32 am

PROBLEM
I created two tables and connected them via a Servoy Relation with a key value. However, this is a One to Many relation. As in, there's multiple records connected to one specific record.

The issue I'm facing is trying to figure out how to load a specific related record to coincide with the main record. Is there a way of doing that?

CODE
Code: Select all
   var record_second = foundset.getSelectedRecord()
   
   /** @type {UUID} */
   var uuid_second = record_second.uuid
   

   forms.form_view.load_2ndUUID( uuid_second )
   
   forms.form_view.load_mainUUID( scopes.MainView.get_main_uuid() )
   
   scopes.NAV.change_forwardForm( 'form_view' )


HELP
Right now I'm getting this secondary record in the 'Many' relation, load it into the foundset & then load the main record in the 'One' relation.... and instead of loading the specified secondary record, it loads another record in the 'Many' relation. Again, I'm not sure how to specify to the foundset which related record I want to load. Is there anything else besides ' foundset.loadRecord( UUID ) ' that I can do that?
john1598360627
 
Posts: 188
Joined: Tue Aug 25, 2020 3:03 pm

Return to How To

Who is online

Users browsing this forum: No registered users and 5 guests