You need to sign in to do that
Don't have an account?
Karleen Mendoza
Formula field to display value from related custom object record?
I want to display a custom field from a custom object that is related to a Task. Basically, we have a custom object named Policy - I want to pull the Expiration date from the Policy record and put that field's value onto the related Task record. How do I do this? The formula field allows to pull related Opportunity fields, but not custom object fields?
Custom task fields can only access the Id (WhatId) of the parent record irrespective its standard or custom object. This limitation is due to the polymorphism that means a task can be associated to opportunity, account, custom obj, etc. SF is working on how to grab the polymorphic related record values. If you are saying you can access opportunities fields in the related task list, then I am not aware of it and will be really interested in knowing it. May be I missunderstood your use case.
However there is a way how one could achieve this, creating a process builder, accessing the what id and determining the type.. I can explain in detail if you want.
Hope this helps.
Cheers, Dev
Thanks for the response. I understand the limitation - I am hoping there is a workaround. How would I acheive this using Process builder?
Basically, a task record is related to a Policy record. The policy record has a field called Expiration Date. I want this Expiration Date field on the Task record so our users do not have to flip back and forth to see the Expiration Date. Hope that makes sense.
I understood your use case :-). As I mentioned before there is a way to achieve this with some work. So the work around is as follows:
1. create a process builder that checkst the what id of the task.
2. Every sObject Id has a specific start number, for ex: If it starts with '001'its an account or if '006 then its an Opportunity and so on. This link has more information https://help.salesforce.com/articleView?id=000005995&type=1 . You can get the one for your custom object policy by looking at any record.
3. lets say it start withs 'a00'. From the process builder, invoke an apex method and in that method have a check condition based on the start number and have look up to the record (policy in ur case) and updated the expiration field on your task record.
As I said, it involves som work but this works.
Hope this helps. if yes, please mark the solution green, :-)
Cheers,Dev