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
sfdcboysfdcboy 

Difference between relationship between account - contact and account - opportunity

I know the relationship between account - contact and account - opportunity is lookup on UI with cascade delete set to True in backend.
Considering how you can update a parent from child if relationship is master detail.
I was trying to write a workflow rule to update Account from Contact but account fields werent there to be selected , But when i tried doing same with opportunity Account fields were there in drop down .
I dont get it considering account has same relationship with both objects ,Why is there such difference.
Thanks 
Best Answer chosen by sfdcboy
Malni Chandrasekaran 2Malni Chandrasekaran 2
Rohit,
That is the limitation with Cross-object workflow action. Please refer below.

Link : https://help.salesforce.com/articleView?id=workflow_cross_object_field_updates.htm&type=0 (https://help.salesforce.com/articleView?id=workflow_cross_object_field_updates.htm&type=0)


Standard Object to Standard Object
Cross-object field updates are supported for standard objects that are children of standard objects in a master-detail relationship. However, only these standard-to-standard relationships are supported.
  • Case Comments updating Case
  • Email updating Case
Tip
To create workflow rules so that case comments or emails automatically update fields on associated cases, select Case Comment or Email Message in the Object drop-down list when creating a new workflow rule and select Casein the Field to Update list. Email-to-Case or On-Demand Email-to-Case must be enabled for your organization to use the Email Message in a workflow rule.
  • Opportunity Product updating Opportunity
Note
Cross-object field updates to a parent opportunity's Amount and Quantity fields only work if the opportunity has no opportunity products associated with it.
  • Opportunity updating Account—Supported for both business accounts and person accounts.
Note
If you have workflow rules on converted leads and want to use cross-object field updates on the resulting accounts and opportunities, you must enable the lead setting Require Validation for Converted Leads.
Standard-to-standard cross-object field update actions:
  • Can’t be used in, or assigned to, approval processes.
  • Update a parent record even if the user doesn’t have edit access to it.
Note
If you have Apex code that updates parent fields in the same relationships as a cross-object field update action, consider replacing your code with cross-object field updates. Otherwise, both will fire, and since workflow rules run after Apex triggers, the workflow field update will override any change made by your Apex code.



Please mark it as solved if this helps as a solution.