• avlerik
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
What I'd really like to have is the ability to define a picklist rather than an Auto-Number or a text field as the Name/ID field of a custom object. Since this currently isn't possible, the next best way is to intercept the "New Record" event, offer a page that provides the desired picklist and then populate the Name/ID field in the object's Edit page with the selected value.
 
Here are my problems:
(1) does anybody have a code snippet for creating such a page and populating a picklist with a list of values?
 
(2) does anybody know of a way to pre-populate a read-only (!) field with a customized URL? Populating an editable field in Edit mode is fairly easy, but I just can't figure this out if the field is defined as read-only on the page layout.
 
Any help is appreciated.
 
Thanks,
Erik
We are a global company in the Automotive industry (ca. 4,000 employees) and are seeking a seasoned web programmer with proven skills in all areas relevant for the customization of salesforce.com. Must have experience with HTML and at least one scripting language, and must know how to create powerful web services (Java or .Net). Experience in creating/maintaining S-Controls and programming in Apex Code is a huge plus, as are experience with Ajax, Eclipse and SQL. This is a permanent position in Graz, Austria, and the applicant must be proficient in English and German. If you're interested, then please contact erik@mittmeyer.de.


Message Edited by avlerik on 04-10-2008 10:45 AM
I have the following VF page.

Code:
<apex:page id="AddServiceCallTask" standardController="Service_Call_Task__c" extensions="extServiceCallTask">
    <apex:form >
      <apex:pageBlock title="New Service Call Task" mode="edit">
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}"/>
            </apex:pageBlockButtons>
    
            <apex:pageBlockSection title="Service Call Task Information">
                <apex:inputField ID="ServiceCallNumber" value="{!Service_Call_Task__c.Service_Call__c}">{!strSCN}</apex:inputField>
            </apex:pageBlockSection>
      </apex:pageBlock>
    </apex:form>
</apex:page>

 And the following extension

Code:
public class extServiceCallTask {

    public string strSCN {get;set;}

    public extServiceCallTask(ApexPages.StandardController controller) {
        PageReference pageRef = ApexPages.currentPage();
        Map<String, String> pageParameters = pageRef.getParameters();
        strSCN = pageParameters.get('SCN');
    }
}

The extension outputs the parameter ( {!strSCN} ) underneath the inputfield (under the part where a value would be typed)  instead of setting it as the default value for the field.  The inputField references a lookup field.

There are several places where I need to use this functionality.  What am I doing wrong?






I created a picklist field with three values - One, Two and Three. I set One to be the Default.
 
When I display the picklist field on a visualforce page using inputfield, the drop-down list shows --None-- as the initial item.
 
Am I missing something or shouldn't One be the default?