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
Shawn Low 24Shawn Low 24 

I have created a custom button on the Leads Object that when clicked, it opens up a Task screen, with several fields pre-populated.

I need to populate one more field, but it's a little tricky.
1. Currently, when a new Task is created, the salespersopn needs to select a value for a custom field called "Division". This field is a picklist and it lists all the different divisions our company has.
2. Once they select a Division, the field "Community Site" becomes "active (It's a dependant picklist) and lists all the different tracts of homes we have, for that specific division.
** The field I would like to pre-populate is the "Division" field.
Challenges:
1. I need to prepopulate the Division field during Task creation, so using a workflow or a Process will not work, so the functionality of pre-populating the field needs to be within the coding of the button.
2. The field "Division" on the Task, is a custom field.
Current Button Code:
window.open('/00T/e?tsk1_lkid='+'{!$User.Id}'+'&tsk5=Community Appointment from NHS&who_id='+'{!Lead.Id}'+'&tsk13=Normal&tsk12=Not Started&00Nj000000AMbZA=Community Appointment from NHS');
Screen Shots:
User-added image
The Red Box is the custom field (picklist) "Division".
The Blue Box is the custom field (multi picklist) "Community Site"

Considerations:
The User Detail section on the User record, has a field called "Division". If there were a way to grab the value in this field and pre-populate it into the Division field on the Task, that could be added to the button code, that would be perfect.

Help :)