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
kunakuna 

Auto populate

I am trying to Auto populate the name of a client in Related to Client field in Idea Page .

Idea page is a salesforce standard page.

Onclick of button I have to pupulate the relateded client name in search test box.

I am passing the value for Related to client field as below in URL which is written on button logic

 

https://****.salesforce.com/ideas/editIdea.apexp?c=09aJ00000004CgR&idea.Opportunity__c={! Opportunity.id}&Idea.Account__c={!Account.Id}&retURL=%2Fideas%2FideaList.apexp 

 

On click of button I am getting Id in URL as below

https://***.salesforce.com/ideas/editIdea.apexp?c=09aJ00000004CgR&idea.Opportunity__c=006J00000024XX9&Idea.Account__c=001J0000002cQ1n&retURL=%2Fideas%2FideaList.apexp

 

Can anyone suggest Related to client field is not populating with the value which i am passing in URL. 

 

Thanks

Ajit

ColinKenworthy2ColinKenworthy2

Check the field's id attribute in the html (with Firebug or similar is easiest). That is what you should be using in your url.

 

http://raydehler.com/cloud/clod/salesforce-url-hacking-to-prepopulate-fields-on-a-standard-page-layout.html

kunakuna

Its standard Object.

onclick of button it will take me to Idea object.

Idea object have Opportunity__c Look up fields with search option.From view source i got as below for Opportunity custom field

 

<input  id="thePage:mainLayout:formIdea:pb:ideaCustomFields:Opportunity__c" maxlength="255" name="thePage:mainLayout:formIdea:pb:ideaCustomFields:Opportunity__c" onchange="getElementByIdCS('thePage:mainLayout:formIdea:pb:ideaCustomFields:Opportunity__c_lkid').value='';getElementByIdCS('thePage:mainLayout:formIdea:pb:ideaCustomFields:Opportunity__c_mod').value='1';" size="20" type="text" /><script  type="text/javascript"> 

 

Option is there for searching the Oppertunity name and user can select but my requirement is it should Auto populate the Existing oppertunity name as the button is placed inside detail section of Oppertunity record.

I want to populate the name on Opportunity__c custom field as Oppertunity name onclick of button.

 

I have tried with below option but its not working.

 

Please help me on this.

 

https://****.salesforce.com/ideas/editIdea.apexp?c=09aJ00000004CgR&thePage:mainLayout:formIdea:pb:ideaCustomFields:Opportunity__c={!Opportunity.Name}&thePage:mainLayout:formIdea:pb:ideaCustomFields:Opportunity__c_lkid={!Opportunity.Id}&retURL=%2Fideas%2FideaList.apexp

 

 

https://cs10.salesforce.com/ideas/editIdea.apexp?c=09aJ00000004CgR&Opportunity__c={!Opportunity.Name}&Opportunity__c_lkid={!Opportunity.Id}&retURL=%2Fideas%2FideaList.apexp

 

 

 

ColinKenworthy2ColinKenworthy2

The Ideas page is not like standard and VF pages, the URL hacking does not work. Just look at the url: [...salesforce.com/ideas/editIdea.apexp?id=...] that is not like standard or VF urls.

 

The only thing I can think of is that the button calls a webservice (passing the id of the Opportunity), then the web service creates the idea and somehow the browser is sent to the edit page for the new idea.

 

Or

 

The button goes to a VF page which inserts a new idea and returns the PageReference url for the idea edit page.

ColinKenworthy2ColinKenworthy2

Glad you found the solution !

kunakuna

Still i did not find the solution.

That URL i given for your reference.

That URL also not working .Not able to display the value in Related to Opportunity field.

 

I am not sure is this the correct way to display the value.

 

Thanks

Ajit