How to get related records in delegate class?
7 posts
• Page 1 of 1
How to get related records in delegate class?I defined a relationship with songs table in artists table's relationships.ini, so there is a songs tab appears next to edit tab. Now I want to get all related songs for a specific artist in one of after_action_edit trigger. Can I use df_query() to get those related records? How? Is there any other way to do the same thing besides df_query()? thanks.
Re: How to get related records in delegate class?Sure. Assuming you've got the record object as $record...
Should work just fine.
Re: How to get related records in delegate class?One caveat is that getRelatedRecords and getRelatedRecordObjects return only the first 30 rows by default (for your safety). You can control how many rows are returned by adding some additional parameters:
Check out more about these at http://dataface.weblite.ca/getRelatedRecords or http://dataface.weblite.ca/getRelatedRecordObjects Another useful function is numRelatedRecords http://dataface.weblite.ca/numRelatedRecords
Re: How to get related records in delegate class?Thank you so much. There is another question further: What delegate method can we use for the related records, like those __pullVale(), block__after_new_record_form() for the current table's records? I need to do something in the new/edit related record form? Thanks.
Re: How to get related records in delegate class?The related record form just uses the same blocks as on the regular new/edit form.
Re: How to get related records in delegate class?If I want to output some javascript using block__after_new_record_form(), which delegate class should I put this function into?
Re: How to get related records in delegate class?The best way to see what blocks are available is to set
at the beginning of the conf.ini file. Then load the form you want to modify. It will print out all of the blocks and slots on the page. -Steve
7 posts
• Page 1 of 1
Who is onlineUsers browsing this forum: No registered users and 9 guests |