Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

I am having 1 lookup field country. i want to set it with some default value on UI. How should i implement this?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

One of the best solution is to use trigger. Create a insert trigger and set default value through that trigger.

Another solution is to pass the default value in the url. You have to get the id of that field and a URL can be created to set default value.

For eg. if the id of that field is 'country' , then url would be: https://ap1.salesforce.com/003/e?retURL=%2F003%2Fo&country=USA.

A new button can be created and URL on this button can be set to this one.

share|improve this answer
    
Hi thanks.one more thing i need to do is to replace lookup with picklist.Plz suggest. –  Pankaj Jan 16 '13 at 7:15
    
Can you please elaborate ? –  S.Sharma Jan 16 '13 at 7:27
    
i have one custom lookup field now i need to show it in the form of picklist in visualforce page. –  Pankaj Jan 16 '13 at 7:37
1  
For this , you have to create a Select List on vf page and options of that select list will be the all results of that look-up field. Then you have to use the selected value from drop-down manually and then you can use that field as you want. –  S.Sharma Jan 16 '13 at 7:48
    
Yup.Thanks shankar –  Pankaj Jan 16 '13 at 10:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.