URL Hacking in Salesforce - Episode 2
HEY!!! Welcome back, previously in URL Hacking Episode 1, We saw what URL hacking is all about and how to get the field id’s for your pre-populating functionality.
Many questions are arising from the first episode. Like
- How can we achieve this?
- How does it work for custom fields?
- How it populates custom lookups?
- How does it work for related list of sObject?
And so on…
So here we ensure to resolve all your questions in this Episode 2 and Episode 3.
First of all, to make this magical thing happen. We have to create a custom button on opportunity for this. And the best way is to add it to the page layout of Account related list.
Steps for creating custom button on Opportunity object:
- Click on “Setup” button.
- Search “Opportunity” in Quick Find/Search box.
- Select “Buttons, Links, and Actions” under Opportunity option.
- Click on “New Button or Link”.
- Fill up the details as per your requirements.
- Please add those fields value which you want to pre-populate in the desired format as shown in below image. Like /006/e?retURL={!Account.Id}&accid={!Account.Id}&opp9=1/7/2018&opp3=Pre+Populate+Opportunity&opp7=12345
Note: For giving space between the value you want to pre-populate you can use ”+”. Many more special character are used in text field like”$,&,%,etc” with the help of URL encoder.
- Click on the ”Save” button.
- Click on “Setup” button.
- Search for “Account” in Quick Find/Search box.
- Select “Page Layouts” under Account option.
- Click On “Edit” option to that page layout where you want to add this button.
- Scroll Down to the Opportunity Related List and click on “Wrench”.
- Open “Buttons” and add your custom button to the selected buttons.
- Click On “Save” button.
You can see the same with the below screenshot.
Now the only thing left is creating your record to test the functionality. So hit on your new custom button from the Account’s page layout to create an Opportunity record with the pre-populated fields and you will get a page like this
In the above image, you can see the URL is changed to your custom one. And also the field values is populating with your desired pre-values. Have fun and make your field values pre-populated. Avoiding manual entering is a smart process for the user convenience.
For a further solution of questions, stay tuned to next Episode of URL Hacking…