Skip to main content
How do I add the "account" or "contact" address field to the new "tasks" or "events" page? Our sales person would like to create an event such as a "meeting" and then would like to see the address of the person whom she is going to see. Instead of having to copy and paste the address from the account page to the "location" field it would be great if their was a read only field populated from the account address.
2 answers
  1. Mar 29, 2014, 10:52 AM
    Well, this is called URL Hacking. So each and every element that you see on a Page may it be a drop down, a text box, a checkbox or whatever has unique ID of it's own. So we actually have a way to find the unique ID of an element. When you right-click an element, you would see a pop-up menu and from the same, select Inspect Element. This feature( Inspect Element ) is Browser specific feature. On selecting the Inspect Element, a small docked window would open at the bottom of the page highlighting that very element. You can also see the ID too from that same window. See here:

     

    Well, this is called URL Hacking. So each and every element that you see on a Page may it be a drop down, a text box, a checkbox or whatever has unique ID of it's own.

     

    This tells us that the ID of the location text box on an Event Page is: evt12.

     

    So in Force.com, if you want to pre-fill an element on the Page with a pre-defined value, you can set that via the URL.

     

    So if you notice the Event page(reached by clicking the New Event button from the Account page would look like this:

     

    https://ap1.salesforce.com/00U/e?what_id=0019000000Js5oW&retURL=0019000000Js5oW

    So you can notice these:

     

    what_id=0019000000Js5oW

    retURL=0019000000Js5oW

    So these are some that's there out-of-the-box. We can similiarly mock this:

    https://ap1.salesforce.com/00U/e?what_id=0019000000Js5oW&evt12=Bloomington

    Notice the: evt12=Bloomington

     

    So in essence, what we have to do is, to create an another New Event button which will set and then send in the ev12 with a value fetched from the Account page.

     

    So let us make one then:

    1. Go to Setup | Customize | Activities | Events Buttons and Links

    2. Click New Button or Link

    3. Label it as New Event With Location

    4. Display Type: List Button

    5. Un-check the option - Display Checkboxes (for Multi-Record Selection)

    6. Behaviour: Display in existing window without sidebar or header

    7. Content Source: URL

    8. URL:

      /00U/e?what_id={!Account.Id}&retURL={!Account.Id}&evt12={!Account.BillingAddress}

    9. Click Save

    We now have to add this new button to the Open Activities Related List on the Account page. So here you go:

    1. Go to any Account record

    2. Click Edit Layout from the top right

    3. Scroll to the Open Activities Related List

    4. Click on the Wedge icon

    5. Scroll down and expand the section - Buttons

    6. Un-check the default New Event

    7. From the Available Buttons, select our new button and move it to the Selected Buttons

    8. Click OK

    9. Click Save

    You should be good to go!

0/9000