Table drawer showing parent

  • 1
  • Problem
  • Updated 4 years ago
  • Solved
I am showing a table list of tasks (child) and want to insert a drawer on each row to the account model.

I can do this from a parent to child way but cannot seem to do this from a child record to a parent record?

Is this possible and any ideas how it can be done?
Photo of Chris Mollan

Chris Mollan

  • 590 Points 500 badge 2x thumb

Posted 4 years ago

  • 1
Photo of Anna Wiersema

Anna Wiersema, Alum

  • 10,920 Points 10k badge 2x thumb
Totally doable! 

DIY (you have to think more, but you also get to learn more):
  • Follow this tutorial but with Tasks as your primary model (instead of Accounts) and Accounts as your model for the drawer (instead of Contacts). 
  • Have the condition on your Account object be Id = filterable default off.
  •  When the drawer is loaded have it activate and set the value of this account condition to {{{WhatId}}} or {{{AccountId}}}  (this will bring in that value from the task row in context.  
  • For any components in the drawer set to the account model, add a context condition where Id of record = AccountId of row in context.
and/or, Copy and Paste this page into your org to see it in action:
<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" showheader="true" tabtooverride="Task">
<model id="Task" limit="100" query="true" createrowifnonefound="false" sobject="Task" adapter="" type="">
<field id="Subject"/>
<field id="CreatedDate"/>
<field id="WhatId"/>
<field id="What.Name"/>
<field id="AccountId"/>
<field id="Account.Name"/>
<model id="Account" limit="20" query="false" createrowifnonefound="false" adapter="" type="" sobject="Account">
<field id="Id"/>
<field id="Name"/>
<field id="skuid__Image__c"/>
<field id="skuid__Image__r.Name"/>
<field id="skuid__Image__r.skuid__AttachmentId__c"/>
<condition type="fieldvalue" value="" field="Id" state="filterableoff" inactive="true" name="Id" operator="=" mergefield="AccountId" novaluebehavior="deactivate" enclosevalueinquotes="true"/>
<pagetitle model="Task" uniqueid="sk-1Ck6Ct-71">
<action type="savecancel"/>
<skootable showconditions="true" showsavecancel="false" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" createrecords="true" model="Task" mode="read" uniqueid="sk-1Ck6Ct-72">
<field id="Subject" allowordering="true"/>
<field id="AccountId" valuehalign="" type=""/>
<field id="WhatId" valuehalign="" type=""/>
<field id="CreatedDate" allowordering="true"/>
<action type="edit"/>
<action type="delete"/>
<action type="multi" label="Run multiple actions" icon="sk-icon-magic">
<renderconditions logictype="and"/>
<action type="setCondition" model="Account" condition="Id" value="{{{AccountId}}}"/>
<action type="requeryModel" model="Account" behavior="loadmore"/>
<action type="drawer">
<drawer title="Drawer Area" width="90%" closehandle="true">
<basicfieldeditor showheader="true" showsavecancel="true" showerrorsinline="true" model="Account" buttonposition="" uniqueid="sk-1Clo-b-148" mode="read">
<column width="50%">
<section title="Section A">
<field id="Name" valuehalign="" type=""/>
<column width="50%">
<condition type="contextrow" field="Id" mergefield="AccountId" operator="="/>
<massactions usefirstitemasdefault="true">
<action type="massupdate"/>
<action type="massdelete"/>
<view type="standard"/>
<styleitem type="background" bgtype="none"/>