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
PipPip 

Apex Trigger

Hi,

 

Want to create an apex trigger that when an opportunity is saved it overwrites what a user has entered and puts the account name + a custom field. Can anyone help or give suggestions. Can this be applied to only certain opportunity types?

Kevin SwiggumKevin Swiggum

Is this something you could do with a workflow rule and field update? 

PipPip

I already have this built. But it does require them to enter at least something in the opportunity name before saving. As this is a required field. Is there a way around this?

Kevin SwiggumKevin Swiggum

The only way I've found around that is to override the page layout with Visualforce...and then don't display the name field on your custom page. A fairly extreme solution  with its own pitfalls ... so I'd only recommend doing that if absolutely required.