• EricReichert
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 6
    Replies
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?






Here's what I need.

1) Each Object A is the Master of many Object B's.
2) Each Object B is the Master of many Object C's.
3) If an Object A record is deleted then all of it's associated Object B records are deleted which, in turn, forces Objects B's associated Object C records to be deleted.

The first one is set up and working, although I'm still trying to figure out a way to make it read-only for most users.

The second cannot be set up because Object B is already in a Master-Detail relationship with Object A.

I have no idea if the third is possible.

Does anyone have any suggestions?
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?






Hi all,

I'm having some trouble passing default values into <apex:inputFields> is it possible? For instance if I want to set

<apex:inputHidden value="{c.Sales_Prospect__c}" /> to a certain value can I do it?

Basically I'm looking for a similar action to HTML where I can have something like the following

<input type="hidden" name="sales_prospect__c" value="David G">

I've looked through the attributes of <apex:inputHidden> and <apex:inputField> and noticed there are none for default value.

any help would be much appreciated.

basically my problem is that in my code {c.Sales_Prospect__c} is a lookup field. when I submit the form I have created I know what value I want to put in that field but I just can't seem to do it, it's always blank and creates an unrelated record.

P.S I am new to visual force here

Thanks,

Patrick


Message Edited by patske on 05-30-2008 12:05 AM

Message Edited by patske on 05-30-2008 12:07 AM