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
Laura StanleyHubbardLaura StanleyHubbard 

Custom Detail Button to Link to New Case from Account

We have several custom fields on our case page that need to be prepopulated for certain scenarios. Ideally, a case would be created from a contact detail page custom button (as we need it to have a custom name -- Benefit Confirmation-- the fields would be filled in, the contact and account name from that contact would also be on the case page. Any suggestions on method? Best practice? I have minimal experience with code and am really reaching for answers as we have a week and a half turn around.


Parameters:

I need these fields prepopulated:
Contact Name on Case would be Contact Name from Contact Page (Lookup Field)
Account Name on Case would be pulled from Contact Page (Lookup Field)
Contact Email and Phone would be pulled if available on Contact Page (Lookup Field)
Status = Open (Picklist)
Priority = Low (Picklist)
C3X = WSE (Picklist)
Service = Health and Welfare (Picklist)
Type = Eligibility (Picklist)
Action = Enrollment (Picklist)
Channel = Internal (Picklist)
Subject = "Benefit Confirmation Statement"
Description = "Benefit Elections Audited. Confirmation Statement created. Sent to WSE via email."

Appreciate all suggestions: Please post code/steps.



 
pconpcon
This is pretty easy to do. What you want to do is create a new custom button using some URL hacking.  It's going to be time consuming beause it requires you to look up all the field ids on your object and set them in the button.  Take a look over this blog post [1] and this stackexchange post [2] and let me know if you have any specific questions or run into any issue.

[1] http://raydehler.com/cloud/clod/salesforce-url-hacking-to-prepopulate-fields-on-a-standard-page-layout.html
[2] http://salesforce.stackexchange.com/questions/937/how-do-i-prepopulate-fields-on-a-standard-layout
Laura StanleyHubbardLaura StanleyHubbard
A little background: our agent/call team works in the console of salesforce. I have javascript button enabled on the contact detail page, and it works except for the following:

1. New case pops opens not in the console view
2. Custom fields (dependent picklists) are not populated
3. I have to click 'back to console' to get in the console and it doesnt default open that case in the console.

 
pconpcon
  1. To get it in the console view, you'll need to use the sforce.console.openPrimaryTab method [1]
  2. The process above should work for custom fields.  Does it work for some but not all?
  3. I think #1 would fix that.
[1] https://developer.salesforce.com/docs/atlas.en-us.api_console.meta/api_console/sforce_api_console_openprimarytab.htm