Related Object Reference

  • 1
  • Question
  • Updated 2 years ago
  • Answered
I'm new to Skuid so forgive me if this is an easy answer! I'm trying to pre-populate the ID on a new record created through a table. The ID needs to be that of the record that the page is related to. So there's an opportunity, the skuid page is a custom object...and the new record created from the custom object page needs to relate back to the original opportunity. I can get it to work with the param/url option in the model condition for the "NEW" records...because the url references the opportunity record, however in the "VIEW" records, that same condition pulls the ID for the custom object, not the admission.

Not sure if it's a change I need in the table, the vforce page or what...all help is so appreciated!
Photo of Lauren Ake

Lauren Ake

  • 368 Points 250 badge 2x thumb

Posted 2 years ago

  • 1
Photo of Will.I.Yam

Will.I.Yam

  • 216 Points 100 badge 2x thumb
Hey Lauren,

Welcome to the dark side and joining the Skuid world!

If I understand correctly, your data model is something like this:

Your skuid page is a view of a single Admission and in the table on that page, you have records that are related to that top level admission with a lookup. When you create a new row in that child object, you'd like the row to pre-populate with the Id of the Admission in that reference field. Is that accurate?

Second question: Are you creating this through a row action, a button or the inline table creation?
(Edited)
Photo of Lauren Ake

Lauren Ake

  • 368 Points 250 badge 2x thumb
One layer on top of what you said...there's the opportunity record (non-skuid), then the skuid page is related to the opportunity. The table (row action to create new) needs to pre-populate with the ID of the original opportunity record (so it actually isn't directly related to the record of the skuid page at all).

I think I figured it out though... I did a "field from another model" condition...but chose the skuid page as the model (even though that's technically the same model) and then the field that is referenced back to the oppy from there. It's working so far.

And you're so right about the dark side...this is TRULY addictive!
Photo of Will.I.Yam

Will.I.Yam

  • 216 Points 100 badge 2x thumb
Muahahhaahhahaha I know I'm crossing references here but, resistance is futile!

That sounds like a good approach. Skuid pages are often "data agnostic" meaning that you can connect any number of records to any other number of records through model lookups. We're sneaky like that! Let us know if you run into any other issues and we'd be happy to help!