Skip to main content
On the opportunity page layout I havea related list Case. There is a custom button 'New Case', with the folllowing URL, which leads me to select a Case Record Type:

 

https://na34.salesforce.com/setup/ui/recordtypeselect.jsp?ent=Case&retURL=%2F500%2Fo&save_new_url=%2F500%2Fe%3FretURL%3D%252F500%252Fo

 

How do I auto auto-populate the Opportunity Name when creating a new Case from the Opportunity?

 

However, even though I'm creating the Case from the Opportunity, the Opportunity name doesn't get populated into the Lookup Field.

 

Opportunity Name

 

Any pointers on how to auto-populate this? 

 

Thanks! 
5 answers
  1. Jun 14, 2018, 6:48 PM
    Hi Julia,

     

    For starters you will have to hardcode the recordtypeId in your url. If you want that user should have the liberty to select the record type and then get the fields pre-populated then that is not possible.

     

    After hardcoding the recordtypeid in url, your url will look something like this:

     

    500/e?retURL=%2F500%2Fo&RecordType=0127F000000WT2q&ent=Case

     

    Now in this url you have to assign the Opportunity ID to the custom field

     

    500/e?retURL=%2F500%2Fo&RecordType=0127F000000WT2q&ent=Case&00N7F00000PNxxU={!Opportunity.Id}

     

    In this url,

     

    00N7F00000PNxxU is the custom field ID

     

    Refer this link to know how to find the custom field ID : http://writeforce.blogspot.com/2013/01/prepopulating-fields-using-url-hacking.html

     

    Now when you will click the button you will get the field populated with the Opportunity ID

     

    Let me know if you need any further assistance
0/9000