launch skuid page from skuid page

  • 1
  • Question
  • Updated 1 year ago
  • In Progress
This seems like a no-brainer...but I'm at a loss. I want to be able to create a new child record (that opens in a skuid page) from a table on the parent. There are too many fields on the child record to just do an in-line creation. Thanks!
Photo of Lauren Ake

Lauren Ake

  • 120 Points 100 badge 2x thumb

Posted 2 years ago

  • 1
Photo of Amy Dewaal

Amy Dewaal, Official Rep

  • 8,200 Points 5k badge 2x thumb
Lauren,

You could add a row action on the table that redirects to the url of the Skuid page where you create the child record. If you need to, you can use merge syntax to pass the id of the parent to the create child page with something like /apex/skuid__ui?page=CreateChildPage&id={{Id}} in the URL of the redirect action. Just make sure you have the Id field in the parent model.

Thanks!
Amy
Photo of Lauren Ake

Lauren Ake

  • 368 Points 250 badge 2x thumb
Hi Amy -- I'm trying to do this again, and the Id is not passing into the URL. What obvious oversight am I missing? The Id is in both models.
(Edited)
Photo of Amy Dewaal

Amy Dewaal, Official Rep

  • 8,200 Points 5k badge 2x thumb
The problem might have to do with context, as in, does your action have the context of which row to pull the Id from? If you're doing this action from a row action on a table or from a queue click action, you should be fine. In that case, would you mind posting a screenshot or two of your setup in the page builder?
However, if you're doing this action from a different situation, such as just a button on the page, {{Id}} isn't enough. You have to also specify the model by doing something along the lines of {{$Model.ModelName.data.0.Id}}. In this situation, you should really only pull the Id from models that you know only have one row, because you have to specify which row to pull from (my example above pulls the Id from the first row). 

Thanks!