+ Start a Discussion
steven75steven75 

Custom field populate from URL parameters.

Hi,

 

https://na7.salesforce.com/500/e?retURL=%2F003A0000007URtJ&def_contact_id=003A0000007URtJ&def_account_id=001A0000009ufGA&Opportunity__c=Opt1

 

I am trying to populate a Custom Field name "Opportunity" in Case, but capture the passing parameters on the URL.  The URL above has Opportunity__C=Opt1, so basically, I want to populate "Opt1" value in the custom field name Opportunity in the new Case.

 

Thank you,

 

 

SurekaSureka

Hi,

 

Instead of giving "Opportunity__c = Opt1" , use the Id of the Opportunity custom feild.

 

For eg.  /a0F/e?00NR0000000ZqY1={!Opportunity.Name} - where "00NR0000000ZqY1" is Id of the Custom Opportunity feild.

 

If the Opportunity custom feild is lookup then use, "CF00NR0000000ZqY1"

 

Hope this helps.

 

Thanks

Sureka

a459295360a459295360

string Opportunity_1 = ApexPages.currentPage().getParameters().get('Opportunity__C');

 

This can get the parameter's(opportunity_c) value...

steven75steven75

Thank you both for replied on this.

 

I am new to Salesforce so can you please show me quick steps how to do this.

 

So I have a created new Case button with this code to pass the Opportunity.ID to the new Case page when I clicked.

/500/e?retURL=%2F500%2Fo&def_opportunity_id={!Opportunity.ID}

 

After the button clicked, it goes to new Case page, and the URL will be like this.

https://na7.salesforce.com/500/e?retURL=%2F500%2Fo&def_opportunity_id=006A0000003FnpU

 

In my new Case page has a textbox called "Opportunity", how can I capture "006A0000003FnpU" then populate in the field name Opportunity with an Opportunity.Name?    Where can I put "string Opportunity_1 = ApexPages.currentPage().getParameters().get('Oppor tunity__C');"?  do I have to modify some standard class for the Case?

 

Thank you,

 

Saurabh DhobleSaurabh Dhoble

You can look at this series of posts for a better explanation on passing parameters via URL.