You need to sign in to do that
Don't have an account?
How to create NEW CASE button within Opportunity screen
We would like to have the ability for our Sales Reps to be able to create a new case from within an opportunity screen. That case then would be related to that opportunity only.
Salesforce allows you to see related cases once you enable the relational list for cases in the layout edit mode, but does not give you a NEW CASE button anywhere in the Opportunity screen.
Here is what I have done so far.
Under CASES > FIELDS I created a custom relationship lookup field called RELATED OPPORTUNITY | API Name: Related_Opportunity__c. I added the new lookup field to the case layout. It works fine from within the case screen. I can lookup opportunities with no problem. Under CASES > BUTTONS AND LINKS I created a new list button called NEW CASE.
Button Details:
/500/e?retURL=%2F500%2Fo
&cas4_lkid={!Account.Id}
&cas4={!Account.Name}
&006M0000004yR7w_lkid={!Opportunity.Id}
&CF006M0000004yR7w={!Opportunity.Name}
&opp4={!Case.Account}
&CF00N00000007E8N3={!Case.CaseNumber}
&cas3_lkid={! NULLVALUE (Case.ContactId, Contact.Id )}
&cas3={! NULLVALUE (Case.Contact, Contact.Name )}
&cas6=Pre-Sale
&cas11=AE - Web
&retURL=/{!Opportunity.Id}
&saveURL=/{!Opportunity.Id}
When I hit the NEW CASE button within the opportunity screen, it takes me to new case creation screen like it should. Some fields like Account Name gets updated with the correct info except for the RELATED OPPORTUNITY field.
Where am I doing wrong? The ID of the RELATED OPPORTUNITY field is: 006M0000004yR7w
Please help.
Courtesy of @Dickens3 from the Success boards:
Found easy answer .. Create a "NEW CASE" custom button under the Case Object. Enter the URL from the address bar of the page you want them to be directed to. In my case I wanted a specific record type for cases created from an opportunity so my url was: https://na2.salesforce.com/500/e?retURL=%2F500%2Fo&RecordType=012400000009dkM&ent=Case
Save the new button and then on the Opportunity layout page, go to the Case Related list section, and click on the wrench icon to edit the field - the option to add the new button is now there.
Good Luck!
All Answers
Courtesy of @Dickens3 from the Success boards:
Found easy answer .. Create a "NEW CASE" custom button under the Case Object. Enter the URL from the address bar of the page you want them to be directed to. In my case I wanted a specific record type for cases created from an opportunity so my url was: https://na2.salesforce.com/500/e?retURL=%2F500%2Fo&RecordType=012400000009dkM&ent=Case
Save the new button and then on the Opportunity layout page, go to the Case Related list section, and click on the wrench icon to edit the field - the option to add the new button is now there.
Good Luck!
In this section:
&CF006M0000004yR7w={!Opportunity.Name}&006M0000004yR7w_lkid={!Opportunity.Id}
It looks like you're missing a CF (assuming thats a custom field.) And also a _lkid if that's pointing to a Lookup field
It should probably be:
&CF006M0000004yR7w_lkid={!Opportunity.Id}
&CF006M0000004yR7w_lkid={!Opportunity.Name}
So:
&CF006M0000004yR7w_lkid={!Opportunity.Id}
&CF006M0000004yR7={!Opportunity.Name}
Works great now!
Hi!
I'm completely new to Salesforce and URL hacking done this way.
I have the same problem as above, BUT with another field on the Case object and that is Contact Name (lookup field). I can't seem to be able to populate the field with the value from my Opportunity custom field Contact__c. Or more exact the value is shown in the field Contact Name on the case, but I get - Error: Invalid Data. If I save the case anyway it gets saved correctly using the button seen below. I have tried with cas3_lkid=, as it is a lookup field, but don't know what Id to use.
Here is my button code:
retURL=%2F500%2Fo&
accid={!Account.Id}
&cas4={!Account.Name}
&cas3={!Opportunity.Contact__c}
&CF00N0Y00000Cq2kO_lkid={!Opportunity.Id}
&CF00N0Y00000Cq2kO={!Opportunity.Name}
Can someone please tell me what I'm doing wrong here?