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
Rachel LinderRachel Linder 

Write a Trigger Validation Rule for SE Approvals on Custom Object

Ok I am wondering if the following is best to do with a trigger or a validation rule.
I have a custom object called "SE Approvals" that is a master detail relationship to the opportunity. It contains the fields:

Fields on SE Approvals Object
SE Approvals Object Fields
Manufacturer - Picklist Field
Quote Number - Long Text Area Field
SE Approval Date Field - Date/Time Field

What we would like is for the validation rule or trigger to happen when any of the fields above are blank and the opportunity is being changed to one of the following stages and one of these transacation types:

Opportunity Object Stage Fields
Closed Won
Closed & Shipped
Closed & Booked
Closed and Recurring
Closed & Recurring

Opportunity Transaction type fields
IIS (Buy/Sell)
IIS (Professional Services)
IFS/IIS (Lease Deal with Supply
IFS/IIS (Lease Deal with Supply and Rebill

Is it possible to tweak the rule above?
ShashankShashank (Salesforce Developers) 
This can be done easily with a validation rule, and you should prefer it over a trigger as it is easy to maintain. Please try to come up with a formula for the validation in your org and and let me know if you are stuck.
Rachel LinderRachel Linder
I have been trying to think of how this would be written since it involves the opportunity object and the SE Approval object (has a master detail relationship to the opportunity. Can you please help?
Thanks.