Reference ID from drawer's context in Redirect to URL global action on table in drawer

  • 1
  • Problem
  • Updated 3 years ago
  • Solved
I have an Account Detail Skuid Page, where I have a tab that shows Meetings, meetings being a custom object. On the tab is a table of meeting records, and in the table is a drawer that shows all emails sent related to that particular meeting record. 

Now, I want to use the Send an Email button to create a new email that when the page pulls up is related to that particular meeting record. So, I need to pass the ID of the meeting__c record in the URL

Here's what I can't figure out:

/_ui/core/email/author/EmailAuthor?p2_lkid={{#$Model.AccountData.data}}{{Id15}}{{/$Model.AccountData.data}}&rtype=003&p3_lkid={{{Meeting__c.Id.goesheresomehow}}}&template_id=00XE0000000SAJ0&retURL=%2F{{$Param.id}}

I've just kind of ignored the p2_lkid because I don't need to specify who I'm sending it to.

The table where the Send an Email button lives is in the drawer of the meeting, but the table itself has a model of MeetingEmails, with a Context of WhatID = ID of the meeting__c

Any ideas on how I can reference the Id of the drawer's context on a table in the drawer?
Photo of Jack Sanford

Jack Sanford, Champion

  • 8,322 Points 5k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Jack,

Perhaps I'm not understanding completely. Can you just use the WhatID from the first row in MeetingEmails, since that's the same as the ID of Meetings? {{{$Model.MeetingEmails.data.0.WhatID}}}
Photo of Jack Sanford

Jack Sanford, Champion

  • 8,322 Points 5k badge 2x thumb
That's definitely the syntax I was looking for, but it's not working. It loads my template so it is passing data, but it's still not loading that data into the page at all, it's just not finding anything there. 

I think the problem is that it's on a table within a drawer within a table. I just don't know how to pull the ID from the table's context, which is the ID of the row in the parent table. 

I got it to work by creating a Send an Email Row Action on the parent table and then I could just use  p3_lkid={{{Id}}}
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Nice. The simple solution is the best. :)
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
The other thing you could do is add a page title to the drawer that has a "new email" link.  The page title would be on the same model as the parent table, and a context condition would limit the page title to model data from the correct row of the parent table. 

Then your email url code could be the same as you are using above. 
Photo of Jack Sanford

Jack Sanford, Champion

  • 8,322 Points 5k badge 2x thumb
Sweet! That works too