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
len123len123 

Override Save button

I want to override the Save button.
 
I have two lookup fields in the opportunity:
1. Relationship to another opportunity which is a father deal for this opportunity
2. Account - which is the company the father opportunity and current opportunity are related to.
 
I want the user to fill in only the relationship to the opportunity and the account will be updated automatically when doing save from the account related to the father opportunity.
 
How do I do that?
SaaniaSaania
You need to add a workflow rule on a field update. Setup->Create->workflow and approvals->field update, would create a field update and then write a workflow from Setup->Create->workflow and approvals-> workflow rules to trigger an update on creation of new records.
TCAdminTCAdmin
Hello len123,

I don't think that the workflow rule will work because it would be pulling information from a different object, which it can't do. An Apex trigger would be able to do this if you have access to it. If you don't have that then you will need to utilize an inline s-control to populate this after the record is created or a button to initiate it. The modification of the Save button isn't available at the current time.