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
TigerPowerTigerPower 

Autofill Case fields with information (fields) from Opportunity?

Hey,
How do you do this: I need to get information (three fields) from my Opportunity page to Case page (with those very same fields). Is it possible to some how take care of this kind of task?

For example when converting a Lead into Account and Opportunity, the fields are autofilled by the information from that Lead. Nice and easy! I would like to do something similar with Opportunity --> Case, and be able to choose which fields are needed.

Is this a piece of cake thing or what? Help needed!

:smileyindifferent:

Yours,
TigerPower


Ron929Ron929
If you're using a custom button,  you can use the !URLFOR function.  Here's an example of one we've used.

(!URLFOR($Action."OBJECT NAME", NEW,null,null, TRUE))&"FIELD LABEL"={!OBJECT.FIELDNAME}&"FIELD LABEL2"={!OBJECT.FIELDNAME2}

if you wanted to return to your original object, you can append &saveURL=%2F{!Opportunity.ID} at the end of the statement.

etc.
The code depends on the field id names in the label for= value and are dependent on your instance, if you use sandboxes.

TigerPowerTigerPower
Hey Ron929,
and thank you for your answer! I was able to solve this auto populating with URL by myself, but I copied that syntax you posted and saved that for upcoming cases.

Yours,
Anne
Jimmy JuaresJimmy Juares
I have a similar question:

I am attempting to create a new Case from an Opportunity with the Opportunity field (custom field: Look Up Reference)prepopulated. I understand that there are several ways to accomplish this, but I can't find a solution, please help.

This is what I have so far:
(!URLFOR($Action.Case.NewCase, Case.Id, null, TRUE))&cas3={!Opportunity.Name}&cas3_lkid={!Opportunity.Id}

This 'Detail Page Link' results in a "URL No Longer Exists". Any Suggestions?!
TigerPowerTigerPower
Hey,
here's one sample, that I was able to follow and successful populate the fields I was suppose to.

/500/e?cas4={!Account.Name}&
cas3={!Contact.Name}&
00N30000001gbgC={!Account.Client_Number__c}

500 is 'front door' to case tab, then you have to write /e? and the field name that you want to populate via URL. With merge field you choose where from the information is coming. If you have to populate more than just one field, use & to add more.

Hope this helps you! :smileyhappy:

ps. for those who don't know it yet... use firefox plug-in to discover the field names!
Jimmy JuaresJimmy Juares
This solution worked for me. Here are the instructions in detail:

STEP 1
Create a new custom field in Cases: Setup>App Setup>Customize>Cases>Fields>Case Custom Fields & Relationships: New
Data Type: Lookup Relationship
Field Label: Opportunity
Related To: Opportunity
Description: Opportunity Case

STEP 2
Create an new S-Control: Setup>App Setup>Develop>S-Controls>New Custom S-Control.
Label: Opportunity Case
Description: Create a new Case for an Opportunity.
S-Control Name: Opportunity_Case
Type: URL
Content: /500/e?retURL=%2F{!Account.Id}&def_account_id={!Account.Id}&CF00N80000002lltQ={!Opportunity.Name}

STEP 3
Create a new link in Opportunity Layout: Setup>App Setup>Customize>Opportunities>Buttons and Links>Custom Buttons and Links: New
Label: Create New Case
Name: Create_New_Case
Description: Create a new Case from an Opportunity.
Display Type: Detail Page Link
Behavior: Display in a new window (make sure to disable 'Block Pop-Up Windows")
Content Source: Custom S-Control
Content: Opportunity Case [Opportunity_Case]
Remember to display this link in the Opportunity Page Layout.