• mr209204
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 15
    Replies
What I am trying to do is run a query on all Opportunity Contact Roles for a Contact and get the Opportunity Amount

The Query Looks like This
Select o.Opportunity.AMount, o.Opportunity, o.ContactId From OpportunityContactRole o WHERE o.ContactId =  ???

And that is where my problem comes in I need to get the Id from the page. I'm still new at this so any comments and suggestion are greatly appreciated.

This is what I have so far.

Code:
public class myClass 
{
Decimal x = 0;
for (Select o.Opportunity.Amount, o.OpportunityId, o.ContactId
From OpportunityContactRole o
WHERE o.ContactId = Id goes here )
{
x += o.Opportunity.Amount;
}
}

 

What I am trying to do is have different sections outputFIelds appear based on a multi-picklist. Lets say we have three items in this multi-select picklist...teacher, volunteer and student.

here is what I have so far.

Code:
<apex:page StandardController="Contact" tabStyle="Contact">        
    <apex:sectionHeader title="View Contact" />  
      
    <apex:form >   
           
        <apex:pageBlock title="Contact Detail" id="thePageBlock" mode="edit">                         
        <apex:facet name="footer">
            <apex:outputpanel >
                <apex:commandButton action="{!edit}" value="Edit" styleClass="btn" />                 
                <apex:commandButton action="{!delete}" value="Delete" styleClass="btn" />  
            </apex:outputpanel>                         
        </apex:facet>    
       
                   
            <apex:actionRegion >                
                <apex:pageBlockSection title="Contact Type" columns="1">                    
                    <apex:pageBlockSectionItem >                                                                     
                        <apex:outputPanel >                            
                            <apex:outputField value={!contact.Contact_Type__c}">                                                                                          
                            </apex:outputField>                                                                            
                        </apex:outputPanel>                    
                    </apex:pageBlockSectionItem>       
                </apex:pageBlockSection>            
            </apex:actionRegion>
            
            
                                                            
            <apex:pageBlockSection title="Basic Contact Information" columns="2">                                                               
                <apex:outputField value="{!contact.name}" />
                <p>
                <apex:outputField value="{!contact.MailingStreet}" />
                <apex:outputField value="{!contact.MailingCity}" />
                <apex:outputField value="{!contact.MailingState}" />
                <apex:outputField value="{!contact.MailingPostalCode}" />
                </p>
                <p>
                <apex:outputField value="{!contact.Referred_By__c}" />
                <apex:outputfield value="{!contact.Best_Way_to_Contact__c}" />
                <apex:outputField value="{!contact.Phone}" />
                <apex:outputField value="{!contact.MobilePhone}" />
                <apex:outputField value="{!contact.Email}" />   
                <apex:outputField value="{!contact.Email2__c}" />     
                <apex:outputField value="{!contact.Email3__c}" />
                </p>
            </apex:pageBlockSection>     

            <apex:pageBlockSection title="Teacher Information" rendered="{!contact.Contact_Type__c = 'Teacher'}">       
                <apex:outputField value="{!contact.Certified__c}" />    
                <apex:outputField value="{!contact.Grade_Taught__c}" />                                                                                                  
            </apex:pageBlockSection>
            
            <apex:pageBlockSection title="Volunteer Information" rendered="{!contact.Contact_Type__c = 'Volunteer'}" >
                <apex:outputField value="{!contact.Watershed__c}" />    
                <apex:outputField value="{!contact.Watershed_Sub__c}" />      
            </apex:pageBlockSection>
                               
        </apex:pageBlock>    
    </apex:form>
</apex:page>

So right now I have two of the sections. the problem is it works fine with when I only have one of the sections. When I added the second section they both do not appear. I've also tried  putting the sections between if statements and still the same result.

Any suggestions and comments are greatly appreciated.

Mitch.

Is this possible/allowed? Does anyone have any suggestions? I'm thinking its like how people create page layouts for their myspace pages, I don't know how but I'm going to find out heh. Any suggestions are greatly appreciated.

Thanks!
Currently I am using v5.15 and have v6.01 and am having some problems when inserting the data. Has anyone tried to migrate to the newer version? I talked to the EchoSign support and they said they do not support it and they also do not recommend it, but I like pressing the red buttons. That means I'm either stuck with the older version or I just run both versions with all the newer data  on the newer version. I sure everyone would rather not go with keeping both if they could choose.

Has anyone tried this? hopefully successfully also.

I've created some visual force pages using this example

http://wiki.apexdevnet.com/index.php/Visualforce_DynamicEditPage

I've been able to create the example and some other pages successfully and replacing the input field from the drop down menu to check boxes which isn't too hard. I am now trying to create a page and trying to do this with a Multi-Select Picklist and it is not quite working. Any help is greatly appreciated.

This is what I have so far.

Contact_Type__c is the multi-select picklist

Code:
<apex:page standardController="Contact" tabStyle="Contact" >
<apex:form >
    <apex:sectionheader title="Create New Contact"> 
        <apex:actionregion >   
        <apex:pageBlock title="Contact Information" id="thePageBlock" mode="edit">
        
            <apex:pageBlockSection title="Basic Information" columns="1">
                <apex:inputfield value="{!contact.firstName}" />
                <apex:inputfield value="{!contact.lastName}" />
                <apex:inputfield value="{!contact.MailingStreet}" />
                <apex:inputfield value="{!contact.MailingCity}" />
                <apex:inputfield value="{!contact.MailingState}" />
                <apex:inputfield value="{!contact.MailingCountry}" />
                <apex:inputfield value="{!contact.MailingPostalcode}" />
                <apex:inputfield value="{!contact.Phone}" />
                <apex:inputfield value="{!contact.MobilePhone}" />
                <apex:inputfield value="{!contact.Fax}" />
                <apex:inputfield value="{!contact.Email}" />

                <apex:pageBlockSectionItem>                        
                        <apex:outputLabel value="Contact Type"/>                        
                        <apex:outputPanel >                            
                            <apex:inputfield value="{!contact.Contact_Type__c}">                                
                                <apex:actionSupport event="onchange" rerender="thePageBlock"status="status1"/>                            
                            </apex:inputfield>                           
                            <apex:actionStatus startText="applying value..." id="status1"/>                        
                        </apex:outputPanel>                    
                </apex:pageBlockSectionItem> 
                
                <apex:pageBlockSection title="Volunteer" Columns="1" rendered="{!contact.Contact_Type__c = 'Volunteer'}">
                    <apex:inputfield value="{!contact.Volunteer_Certifications__c}" />
                </apex:pageBlockSection>

            </apex:pageBlockSection>
            
        </apex:pageBlock>           
        </apex:actionregion>
    </apex:sectionheader>
</apex:form>
</apex:page>

 

What I'm trying to do is save information from a form. Everything I have done is based off examples from SF Docs like the Cookbook so forgive me if things look a little haphazard. This is the code that I have so far. I know that I have to Include <apex:commandButton action="{!save}"> somewhere in there and that I have to create a method for it. This is where I am stuck. I don't quite understand the examples given to me in the cookbook or the visual force documentation. Here is the apex that I have so far. How do I go about saving all this information once entered?



<apex:page Controller="testController" tabStyle="Contact">
<apex:sectionHeader title="Create new Contact" />

<apex:form >
<apex:pageBlock title="Contact" id="thePageBlock" mode="edit">
<apex:pageMessages />
<apex:pageBlockButtons >

</apex:pageBlockButtons>

<apex:actionRegion >
<apex:pageBlockSection title="Contact Information" columns="1">
<apex:inputField value="{!contact.firstName}"/>
<apex:inputField value="{!contact.lastName}"/>
<apex:inputField value="{!contact.MailingStreet}"/>
<apex:inputField value="{!contact.MailingCity}"/>
<apex:inputField value="{!contact.MailingState}"/>
<apex:inputField value="{!contact.MailingPostalCode}"/>
<apex:inputField value="{!contact.HomePhone}" />
<apex:inputField value="{!contact.MobilePhone}" />
<apex:inputField value="{!contact.Fax}" />
<apex:pageBlockSectionItem >
<apex:outputLabel value="Add Company"/>
<apex:outputPanel >
<apex:inputField value="{!contact.Add_Company__c}">
<apex:actionSupport event="onchange" rerender="thePageBlock"status="status2"/>
</apex:inputField>
<apex:actionStatus startText="applying value..." id="status2"/>
</apex:outputPanel>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:actionRegion>

<apex:pageBlockSection title="Company Information" columns="1"
rendered="{!contact.Add_Company__c == true}">

<apex:inputField value="{!account.name}" />
<apex:inputField value="{!account.BillingStreet}" />
<apex:inputField value="{!account.BillingCity}" />
<apex:inputField value="{!account.BillingState}" />
<apex:inputField value="{!account.BillingPostalCode}" />
<apex:inputField value="{!account.Phone}" />
<apex:inputField value="{!account.Fax}" />
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>

</apex:page>
So what would I have to add on the controller side?



Message Edited by mr209204 on 07-21-2008 02:23 PM
http://wiki.apexdevnet.com/index.php/Visualforce_DynamicEditPage

The example given is using a drop down menu as an example. Is the same possible with a check box? and what is the difference in code between the drop down and check box? Is there any other information that I must provide to further help answer my question?
I'm new to using visual force and well saleforce altogether.

My goal is to create a form, through visual force, that inputs data into multiple objects. I've only been able to do this for one object only.

Links to tutorials or other help is greatly appreciated. I have the cook book and am having trouble understanding what it is telling me in chapter 13, which is the section on Visual Force.

Thanks,
Mitch.
I've recently been wanting to generate a PDF from a visualforce page but with page breaks in various places.  Is this something that I can do using CSS or will I have to have lots of <br /> tags in my page?
Hello..

I'm having problems with sandbox environment. When trying to access some of my VF Pages I get a "URL No Longer Exists" error. Is anyone else having this problem? Sandbox env had been working great but in the last 2 weeks I've been having a lot of weird behavior.
What I am trying to do is have different sections outputFIelds appear based on a multi-picklist. Lets say we have three items in this multi-select picklist...teacher, volunteer and student.

here is what I have so far.

Code:
<apex:page StandardController="Contact" tabStyle="Contact">        
    <apex:sectionHeader title="View Contact" />  
      
    <apex:form >   
           
        <apex:pageBlock title="Contact Detail" id="thePageBlock" mode="edit">                         
        <apex:facet name="footer">
            <apex:outputpanel >
                <apex:commandButton action="{!edit}" value="Edit" styleClass="btn" />                 
                <apex:commandButton action="{!delete}" value="Delete" styleClass="btn" />  
            </apex:outputpanel>                         
        </apex:facet>    
       
                   
            <apex:actionRegion >                
                <apex:pageBlockSection title="Contact Type" columns="1">                    
                    <apex:pageBlockSectionItem >                                                                     
                        <apex:outputPanel >                            
                            <apex:outputField value={!contact.Contact_Type__c}">                                                                                          
                            </apex:outputField>                                                                            
                        </apex:outputPanel>                    
                    </apex:pageBlockSectionItem>       
                </apex:pageBlockSection>            
            </apex:actionRegion>
            
            
                                                            
            <apex:pageBlockSection title="Basic Contact Information" columns="2">                                                               
                <apex:outputField value="{!contact.name}" />
                <p>
                <apex:outputField value="{!contact.MailingStreet}" />
                <apex:outputField value="{!contact.MailingCity}" />
                <apex:outputField value="{!contact.MailingState}" />
                <apex:outputField value="{!contact.MailingPostalCode}" />
                </p>
                <p>
                <apex:outputField value="{!contact.Referred_By__c}" />
                <apex:outputfield value="{!contact.Best_Way_to_Contact__c}" />
                <apex:outputField value="{!contact.Phone}" />
                <apex:outputField value="{!contact.MobilePhone}" />
                <apex:outputField value="{!contact.Email}" />   
                <apex:outputField value="{!contact.Email2__c}" />     
                <apex:outputField value="{!contact.Email3__c}" />
                </p>
            </apex:pageBlockSection>     

            <apex:pageBlockSection title="Teacher Information" rendered="{!contact.Contact_Type__c = 'Teacher'}">       
                <apex:outputField value="{!contact.Certified__c}" />    
                <apex:outputField value="{!contact.Grade_Taught__c}" />                                                                                                  
            </apex:pageBlockSection>
            
            <apex:pageBlockSection title="Volunteer Information" rendered="{!contact.Contact_Type__c = 'Volunteer'}" >
                <apex:outputField value="{!contact.Watershed__c}" />    
                <apex:outputField value="{!contact.Watershed_Sub__c}" />      
            </apex:pageBlockSection>
                               
        </apex:pageBlock>    
    </apex:form>
</apex:page>

So right now I have two of the sections. the problem is it works fine with when I only have one of the sections. When I added the second section they both do not appear. I've also tried  putting the sections between if statements and still the same result.

Any suggestions and comments are greatly appreciated.

Mitch.

Is this possible/allowed? Does anyone have any suggestions? I'm thinking its like how people create page layouts for their myspace pages, I don't know how but I'm going to find out heh. Any suggestions are greatly appreciated.

Thanks!
I've created some visual force pages using this example

http://wiki.apexdevnet.com/index.php/Visualforce_DynamicEditPage

I've been able to create the example and some other pages successfully and replacing the input field from the drop down menu to check boxes which isn't too hard. I am now trying to create a page and trying to do this with a Multi-Select Picklist and it is not quite working. Any help is greatly appreciated.

This is what I have so far.

Contact_Type__c is the multi-select picklist

Code:
<apex:page standardController="Contact" tabStyle="Contact" >
<apex:form >
    <apex:sectionheader title="Create New Contact"> 
        <apex:actionregion >   
        <apex:pageBlock title="Contact Information" id="thePageBlock" mode="edit">
        
            <apex:pageBlockSection title="Basic Information" columns="1">
                <apex:inputfield value="{!contact.firstName}" />
                <apex:inputfield value="{!contact.lastName}" />
                <apex:inputfield value="{!contact.MailingStreet}" />
                <apex:inputfield value="{!contact.MailingCity}" />
                <apex:inputfield value="{!contact.MailingState}" />
                <apex:inputfield value="{!contact.MailingCountry}" />
                <apex:inputfield value="{!contact.MailingPostalcode}" />
                <apex:inputfield value="{!contact.Phone}" />
                <apex:inputfield value="{!contact.MobilePhone}" />
                <apex:inputfield value="{!contact.Fax}" />
                <apex:inputfield value="{!contact.Email}" />

                <apex:pageBlockSectionItem>                        
                        <apex:outputLabel value="Contact Type"/>                        
                        <apex:outputPanel >                            
                            <apex:inputfield value="{!contact.Contact_Type__c}">                                
                                <apex:actionSupport event="onchange" rerender="thePageBlock"status="status1"/>                            
                            </apex:inputfield>                           
                            <apex:actionStatus startText="applying value..." id="status1"/>                        
                        </apex:outputPanel>                    
                </apex:pageBlockSectionItem> 
                
                <apex:pageBlockSection title="Volunteer" Columns="1" rendered="{!contact.Contact_Type__c = 'Volunteer'}">
                    <apex:inputfield value="{!contact.Volunteer_Certifications__c}" />
                </apex:pageBlockSection>

            </apex:pageBlockSection>
            
        </apex:pageBlock>           
        </apex:actionregion>
    </apex:sectionheader>
</apex:form>
</apex:page>

 

http://wiki.apexdevnet.com/index.php/Visualforce_DynamicEditPage

The example given is using a drop down menu as an example. Is the same possible with a check box? and what is the difference in code between the drop down and check box? Is there any other information that I must provide to further help answer my question?
I'm new to using visual force and well saleforce altogether.

My goal is to create a form, through visual force, that inputs data into multiple objects. I've only been able to do this for one object only.

Links to tutorials or other help is greatly appreciated. I have the cook book and am having trouble understanding what it is telling me in chapter 13, which is the section on Visual Force.

Thanks,
Mitch.