How Can I access the Phone Field on the Task Object?

  • 1
  • Question
  • Updated 4 years ago
  • Answered
  • (Edited)
Hey guys, I am a very new Skuid user so apologies in advance for what I expect are a string of newbie questions. I am stoked to be working with this framework though as it's pretty awesome!

One of my first tasks is building a new task view page, and I am finding that I can't find all the fields I would see even on a normal task page. 

For example, the "Phone" field one typically finds on the task layout is nowhere to be found. I would expect it to be accessed via the WhoID but no luck there. 

Appreciate any help! Thanks. 
Photo of Justin Norris

Justin Norris

  • 782 Points 500 badge 2x thumb
  • unsure

Posted 4 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
The phone number and email in the standard layout are coming from the WhoId field.   Unfortunately with Skuid you can not traverse the polymorphic whoId field and retrieve associated data about the contact or lead into the same model.

But there are ways around this problem.  (And that is what is great about Skuid!)  Here is what you should do. 

  • Create two additional models on your page.  One for Leads and the second for Contacts.  Both models should have conditions on them that filter records so that the ID is what is in the WhatId field of the Task Model.

  • Include the associated fields you want for the contact or lead.  You are not limited to Phone number and Email.  Include show size.... 

  • Drag two field editors onto your task layout and populate them with fields from your contact and lead models.

  • Finally - use conditional rendering so that only one of the two field editors shows.  Only show the lead field editor if there are rows in the lead model.  
A side bonus is that the data about the lead or contact is now editable directly on this skuid page.  If that phone number is wrong,  you don't have to jump to another page to fix it! 
Photo of Justin Norris

Justin Norris

  • 782 Points 500 badge 2x thumb
Rob! That makes perfect sense. And also explains to me how to use the conditional rendering for this very purpose which I was struggling to figure out before too. 

Having multiple models editable/viewable on one page is exactly the problem I am trying to solve. 

Once I'm done, this task detail page will show our reps everything they need to action the task in one spot whereas before they'd need to look in 2 or 3 other places. Super exciting stuff!
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Great to hear!