function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
mstev45mstev45 

Cross Object Formula Field

I have a Custom Object called 'Vessel'. In the custom object there is a lookup field to Accounts, so that vessels owned by that account are displayed on the Account page in a related list. I have another field on the Vessel object called Vessel Manager. What i want to do is create a cross-object formula field on the account page so that If the field Vessel Manager contains a certain value, the formula field on the account page is set to a value. I cant seem to create a cross-object formula that will work though.

Any suggestions??

 

Matt

Best Answer chosen by Admin (Salesforce Developers) 
Venkat PolisettVenkat Polisett

Unfortunately, you cannot use cross-object workflows with standard objects (you are trying to update account).

 

Write a trigger on the vessel object (after insert, after update, before delete) and update account if the vessel is managed by you. Currently, this is the only option available to you.

 

 

All Answers

Venkat PolisettVenkat Polisett

Using "Cross object formulas", you can walk up to the parent from a child, but not from child to the parent.

 

If you are looking for a count of children from a master parent object, then use rollup summary field and filter them based on your criteria.  

 

Finally, if you must have it, then create a workflow on child object and populate a field on the parent when a new child row is created or modified.

 

Hope this helps.

mstev45mstev45

At the moment the field is currently a look-up relationships between the vessel owner field and accounts. We dont want to change it to a master-detail relationship as this will mean that the vessel owner field will become a required field, and sometimes the vessel owner is not always known. Also with a master detail relationship, once the account owner has been set it cannot be changed, and vessels often change owners so this would not be ideal for us. Is there any other way to go about this without changing the look-up field to a master detail relationship.?

 

Matt

Venkat PolisettVenkat Polisett

mstev45 wrote:

At the moment the field is currently a look-up relationships between the vessel owner field and accounts. We dont want to change it to a master-detail relationship as this will mean that the vessel owner field will become a required field, and sometimes the vessel owner is not always known. Also with a master detail relationship, once the account owner has been set it cannot be changed, and vessels often change owners so this would not be ideal for us. Is there any other way to go about this without changing the look-up field to a master detail relationship.?

 

Matt


From the above write-up, I am assuming that you are looking to count the vessels owned by a particular owner. As you are not open to changing the relationship type, your other option is write a work flow as described in my prior post.

 

Please explain your correct requirement. It is not very clear to me from your original post.

 

 

mstev45mstev45

Ok ill try and make things a bit clearer.

 

What we have created is a custom object called Vessel. On the Vessel Page are fields called Vessel Owner, which is a look-up detail field to Accounts, another field we have is Vessel Manager which is just a text field.

So when a vessel is linked to an account then it will be displayed on the Accounts page in the Vessel Related List. 

We are a company that manage vessels, however not all of the vessels enetered into the system will be managed by us. Therefore on the account page i want to have a field that says whether or not we manage the vessels belonging to that Account.

Hopefully this makes things clearer?

 

Matt

Venkat PolisettVenkat Polisett

Unfortunately, you cannot use cross-object workflows with standard objects (you are trying to update account).

 

Write a trigger on the vessel object (after insert, after update, before delete) and update account if the vessel is managed by you. Currently, this is the only option available to you.

 

 

This was selected as the best answer
mstev45mstev45

Thanks for the help, i will have a look around and read up on triggers. Hopefully i will be able to write the required trigger, does it sound like a complicated trigger to write?

 

Matt