[SalesForce] Formula field on parent object to get last related list record field

I'm trying to create a formula field on a parent object that will retrieve a field from the latest record in a child related list (without apex if possible). The related list is from a lookup field not a master-detail. The parent is a custom object (Sample Orders) and the child is a Docusign Status object.

Is there a way to get a field value from the last created/updated Docusign Status record in a formula field on the Sample Orders object? Again, without apex if possible.

Thanks in advance.

Best Answer

You can achieve this without Apex by using Process Builder on DocuSign Status.

Filters: You would want to filter that the DocuSign Status corresponds to Sample Order as follows:

  • Field - use your lookup as the field, but make sure you use the lookup (ends with __c) and not the relationship (has a right arrow).
  • Operator - startsWith
  • Type - Id
  • Value - use the first three characters (key prefix) for any Sample Order Id. For example, if it were to Account you would use a filter value of 001.

Action: You can then set the field you want on Sample Order from the DocuSign Status.

  • Action Type - Update Records
  • Action Name - whatever you like
  • Field Update - select the same lookup as in your filter, set type to reference, and find your field.
Related Topic