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 value on custom field

I am trying to Auto populate the name of client in Related to Client field which is a custom field on standard Idea object .

Idea is a salesforce standard object.

Onclick of button I have to display relateded Opportunity Name on Related to opportunity test box.

I am trying to pass the value for Related to opportunity field as below in URL which i have written on button logic

https://cs10.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://cs10.salesforce.com/ideas/editIdea.apexp?c=09aJ00000004CgR&idea.Opportunity__c=006J00000024XX9&Idea.Account__c=001J0000002cQ1n&retURL=%2Fideas%2FideaList.apexp

Opportunity value is displaying on the text box.

Can anybody suggest on above issue.
how to populate value which i am passing in URL.
 

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">
I have tried with below option but its not working.
Please help me on this.

https://cs10.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

Thanks
Ajit

Abhinav GuptaAbhinav Gupta

This post will give you pointers to other posts, that try solving the same problem : http://www.tgerm.com/2012/02/field-id-lkid-describe.html

kunakuna

Hi Thanks for your response .

I have tried to use

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

 

Same issue not able to display the name in Related to opportunity custom text field.

 

Can you please guide me if i can try something else.

 

Thanks

Ajit

Abhinav GuptaAbhinav Gupta

If its a task related screen this can work for you 

 

https://ap1.salesforce.com/00T/e?what_id=00690000002FQ74

 

here 00690000002FQ74 is opportunity id.

BondicloudBondicloud

In controller u assign {! Opportunity.id},{!Account.Id} this to two string {get;set;} variables and u access those values in url.
 it will work.
like
  publick string accountID {get;set;}

 accountID = Account.Id;

in url  u use like this  &Idea.Account__c={!accountID };