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
steven75steven75 

New Case Button from Opportunity Record View

Hi,

 

Currently, there is no option to create a New Case while viewing an Opportunity record (there is option for New Task and others).   I call tech support already and noticed by default is not possible to create New Case from Opportunity Record.   Is there an way (Apex code?) to modify the Opportunity view to have a "New Case" button to create a new case?

 

Thanks,

Best Answer chosen by Admin (Salesforce Developers) 
steven75steven75

Got how it opens a New Case view in the parent page now.  thanks.

All Answers

ahab1372ahab1372

just define a custom detail page button of type link and put in the link to create a new case. Go to Setup - Customize - Oportunties - Buttons and Links. In the formula editor, select $Action and then Case.New from the second drop down. The result would be something like

{!$Action.Case.NewCase}

 

Or, you put in the URL   /500/e?retURL=%2F500%2Fo and modify the retURL parameter if you want to redirect back to the opportunity

 

No need for Apex or VF

steven75steven75

hi ahab,

 

Thanks for quick response,

I went to Setup-Customize/Opportunites-Buttons and Links.   Then click New for new button,  I don't see any thingl like $Action, Case.New....

 

Can you please give me the steps to do this?

 

Thanks,

 

ahab1372ahab1372

look under "Select Field Type" and "Insert Field" (the pick lists)

steven75steven75

Sorry, I am currently in Setup-Customize-Opportunities-Buttons and Links.  The only options I have are two buttons "New" and "Default Custom Links",  there is no "Select Field Type" or "Insert Field".

 

Please advise

ahab1372ahab1372

forgot to include it in my instructions: Click on New to create the new button. After you created it, you still need to include it in the opportunity page layout.

steven75steven75

I created a button and went to page layout, try to drag it, but it didn't let me put anywhere in Opportunities page layout.

ahab1372ahab1372

there is only one designated space for buttons on the page layout, next to the standard buttons. Where do you want it to be?

steven75steven75

Right now in the Opportunities, there are different groups (Products, Open Activities, Contact, Partners, Competitors.. Case.),   all these groups has a button "New" to clear a new record EXCEPT Case doesn't have a "New" button.   I would like to place this button in the case group.  Is that posible?

ahab1372ahab1372

so if you want the buton to show up on the related list (that's what the groups are called) for Cases, you have to create the button on the Cases object (Setup - Customization - Cases - Buttons and links, then click New

Define it as a List Button. When you are done, edit the Opportunity Page Layout, scroll to the Related List for Cases and click on the little wrench symbol. A new "window" pops up. At the bottom of it, there is a section for Buttons that you need to expand. Then you can include your custom button.

 

Now that I think about it, in the very same place you can also activate the standard button for new Cases, so you don't have to create your own ...

steven75steven75

Thank you very much for helping.   I am most there...

I got the button there already, but when I click it,  I got an error "URL No Longer Exists" and looks like it tries to open another page within the SalesForce Frame....  

I also double-checked my button Select Filed Type and Insert Field,  I have this "{!$Action.Case.NewCase}" as your instruction.  

 

Any idea?

 

steven75steven75

Hi,

 

I put the URL "/500/e?retURL=%2F500%2Fo" in the formula for button, and it seems to jump to New Case page,  however it opens entire page within the mainFrame (middle), and I am now getting two menu bars (Home, Campaigns, Leads....).   Any way I can jump to New Case using _parent window (frame)?

 

Thanks,

steven75steven75

Got how it opens a New Case view in the parent page now.  thanks.

This was selected as the best answer
billybluebonesbillybluebones

How can I use this button (as described above) to automatically fill in information in custom fields drawn from the Opportunity?