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
theomantheoman 

Customized New Event Window

I'm a beginner VisualForce user. On my front burner is the challenge of customizing my New Event "Related To" field -- I need to remove some of the Drop Down options and default to a custom object, as show in the picture. Would greatly appreciate help pointing me toward a solution.


 

 

Thanks in advance.

 

Best Answer chosen by Admin (Salesforce Developers) 
SFFSFF

The picklist values for Related To are based on the objects that the current user has acess to. You cannot remove items from this list - without using Javascript - without removing access to these objects. If that is appropriate - if your users will not ever need to see Assets, Cases, or Contracts - then by all means remove their access via profile - and they will disappear from this list.

 

It is possible to use a Javascript hack to remove items from the DOM. I don't recommend it, but if you want some sample code, look here:

 

http://www.salesforcefast.com/2011/03/altering-page-elements-with-javascript.html

 

To set a default on the Related To field, you can use a custom URL hack, similar to the sample code here:

 

http://www.salesforcefast.com/2010/04/request-account-delete-custom-button-to.html

 

Obviously, in this case, you would use evt3_mlktp instead of tsk3_mlktp. For more information on standard field IDs for URL hacking, look here:

 

http://www.salesforcefast.com/2012/09/what-are-standard-objects-field-ids.html

 

Good luck!