how can I associate a new task to a custom object?

  • 1
  • Question
  • Updated 6 years ago
  • Answered
I am trying to add a new task to a custom object using inline editing on a table. I have a custom object called 'Airport'. on the skuid Airport page there is a tab that contains a table with tasks as the model. I am using the default green '+' to add a new record. It creates the task, but does not relate it to the Airport. In the standard salesforce page, when I create a task from the airport it automatically sets the "Related To" to the correct airport. How do I get Skuid to set the 'related to' to the current Airport?

Photo of Andy Chasin

Andy Chasin

  • 382 Points 250 badge 2x thumb

Posted 6 years ago

  • 1
Photo of Moshe Karmel

Moshe Karmel, Champion

  • 8,686 Points 5k badge 2x thumb
It sounds like Task looks up to Airport. If that is the case you can add a condition to the Task model, where "Related To" is the value of the Id from the first row of the Airport model, and that should do the trick. Also make sure that you have selected the Airport field in your Task model.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 45,308 Points 20k badge 2x thumb
For those following along at home - Andy had established the condition on the task model such that he was using field  What.Id (found by navigating through the Opportunity/Account object relationship to the ID field underneath).   This filters existing records fine, but does not prepopulate data in new records - since it is a read only field (being on the parent object).

What Andy needed to do was create a condition on the field  WhatId  (the lookup field directly on the Task object).

The dot makes all the difference.  
Photo of Andy Chasin

Andy Chasin

  • 382 Points 250 badge 2x thumb
Thanks again Rob!