JAVASCRIPT TO HIDE CERTAIN LEAD SOURCE OPTIONS
I'm trying to hide certain option values from the LeadSource choice fields that we don't want selectable from the dropdown no longer. I'm using the code below to try to remove one of the options, however, the code doesn't seem to work on the leadsourcecode
field.
oContactCustomization2 = {
hideLeadSource: function (context) {
var formContext = context.getFormContext();
var testOptionSet = formContext.getControl("leadsourcecode");
if (testOptionSet !== null) {
testOptionSet.removeOption(12);
}
}
};
I've tried the exact same code on a different custom field and it worked successfully, so I'm not sure if there's something specific to the out-of-box Lead Source field that makes it so the Javascript doesn't work. If anyone has any insight or ideas as to how I can use JS on the standard Lead Source field, that would be helpful. My last resort is to duplicate the lead source field, but that would also require copying over all the data from the standard field to the custom one.
Thank you!