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
FenoFeno 

Force Account Name into an Opportunity

Hello everybody,
I'm searching for a s-control that for a certain record type fills automatically the field "account name" in the opportunity whith a certain value (always the same). The field should be also set as read only.

Sorry but I don't know anything about s-control programming.

can anybody help me?

Thanks

Feno
werewolfwerewolf
You can't really do this because the Account is a globally required field on Opportunity, so no one is ever going to be able to save one with that field null, and you can't hide that field or make it read only on the page.
NordbergNordberg
You could create a custom button for that specific type of opportunity, in which it pre-defines the record type and adds the Account name, and use a validation rule against the Account name that does not allow it to change from the name, or you could just create the validation rule, that says if it is a particular record type only allow the user to enter the Account name you want.  The error message could spell out the Account name for your user.