• DRobi83
  • NEWBIE
  • 30 Points
  • Member since 2012

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 14
    Questions
  • 19
    Replies

Hello

 

I have a class which is looking up object records to display in a picklist. My issue is that by default, the picklist field is displaying a value. I would like to default value to be NULL (user has to select one), and then the values under NULL (- None -) be the records of my class query

 

Thanks in advance

 

VF

 

<apex:page standardController="Invoice__c" extensions="newInvoiceLineItems,CurrencyPL,TaxPL,ProductPL">
    <apex:form >
    <apex:sectionHeader title="Invoice and Credit Memo" subtitle="{!Invoice__c.Name}"  /> 
    <apex:pageBlock title="Invoice and Credit Memo Detail" >
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}" rerender="error" />
                <apex:commandButton value="Cancel" action="{!cancel}" rerender="error" />
            </apex:pageBlockButtons>
            <apex:pageMessages ></apex:pageMessages>
        <apex:pageBlockSection title="Information" columns="2" collapsible="false">
            <apex:inputField value="{!Invoice__c.Customer__c}" required="true" />
            <apex:pageBlockSectionItem >
                <apex:outputLabel value="Currency"/>
                <apex:outputPanel layout="block" styleClass="requiredInput" >
                <apex:outputPanel layout="block" styleClass="requiredBlock"/>
                <apex:selectList value="{!Invoice__c.Currency__c}" 
                     required="True" size="1" id="invoicecurr">
                    <apex:selectOptions value="{!getCurrency}"/>
                </apex:selectList>
                </apex:outputPanel>
            </apex:pageBlockSectionItem> 
            <apex:inputField value="{!Invoice__c.Date_Document__c}" required="true" /> 
            <apex:inputField value="{!Invoice__c.Due_Date__c}" required="true" />
            <apex:inputField value="{!Invoice__c.Type__c}" required="true" />  
            
            <apex:pageBlockSectionItem >
                <apex:outputLabel value="Description"/>
                <apex:outputPanel layout="block" styleClass="requiredInput" >
                <apex:outputPanel layout="block" styleClass="requiredBlock"/>
                <apex:inputTextarea value="{!Invoice__c.Description__c}" required="true" cols="40" rows="3" /> 
                </apex:outputPanel>
            </apex:pageBlockSectionItem> 
            
        </apex:pageBlockSection>   
            <apex:pageBlockTable value="{!lines}" var="li" id="table">  
                <apex:column headerValue="Line Items" colspan="2">
                    <apex:outputLabel value="Description"/>
                    <apex:inputField value="{!li.Display_Name__c}" required="true"/>
                    <apex:outputLabel value="Amount inc Tax"/>
                    <apex:inputField value="{!li.Amount_Inc_Tax__c}" required="true"/>
                    <apex:outputLabel value="Invoice"/>
                    <apex:inputField value="{!li.Invoice__c}"/>
                    
               <apex:outputLabel value="Currency"/>
                        <apex:outputPanel layout="block" styleClass="requiredInput" >
                        <apex:outputPanel layout="block" styleClass="requiredBlock"/>
                            <apex:selectList value="{!li.Currency__c}" required="True" size="1">
                    <apex:selectOptions value="{!getCurrency}"/>
                </apex:selectList>
                </apex:outputPanel>

               <apex:outputLabel value="Product"/>
                        <apex:outputPanel layout="block" styleClass="requiredInput" >
                        <apex:outputPanel layout="block" styleClass="requiredBlock"/>
                            <apex:selectList value="{!li.Product_For_Sale__c}" required="True" size="1">
                    <apex:selectOptions value="{!getProduct}"/>
                </apex:selectList>
                </apex:outputPanel>
                
               <apex:outputLabel value="Tax"/>
                        <apex:outputPanel layout="block" styleClass="requiredInput" >
                        <apex:outputPanel layout="block" styleClass="requiredBlock"/>
                            <apex:selectList value="{!li.Tax__c}" required="True" size="1">
                    <apex:selectOptions value="{!getTax}"/>
                </apex:selectList>
                </apex:outputPanel>                
                    
                    <apex:outputLabel value="Quantity"/>
                    <apex:inputField value="{!li.Quantity__c}" required="true"/>
                                                       
                    <apex:commandLink value="Add Row" action="{!addRow}" rerender="table,error" immediate="true" />&nbsp;|&nbsp;&nbsp;
                    <apex:commandLink value="Remove Row" action="{!removeRow}" rerender="table,error" immediate="true" />
                 </apex:column>    
            </apex:pageBlockTable>   
              
    </apex:pageBlock>
    </apex:form>
</apex:page>

 

class

 

public class ProductPL {
    private miiFinance__Invoice__c invoice;
    public ProductPL(ApexPages.StandardController controller) {
    this.invoice = (miiFinance__Invoice__c)controller.getRecord();
    }
    public List <SelectOption> getProduct {
    Get{
    List <SelectOption> product = new List <SelectOption>();
    for( miiFinance__Product_For_Sale__c pr: [select Name, miiFinance__Display_Name__c from miiFinance__Product_For_Sale__c])
    product.add(new selectOption(pr.id, pr.Name + ' - ' +  pr.miiFinance__Display_Name__c));
    return product;
    }
    Set;
    }
    }

 

 

Hello

 

I have some working code the way i want it, however when you click the "Add Row" or "Remove Row" command links, all my previously created values (line items) default the drop down fields back from their selection, to a default selection. Essentially, the user loses all their previous selections. Its further worth noting that the 'picklists' are actually lookup values being called from a class


Does anyone have any changes/ideas about the code to make it so the values are set and not 'rerendered' when you click my commandLinks?

 

Thanks in advance, been all day on this!

 

VF

 

<apex:page standardController="Invoice__c" extensions="newInvoiceLineItems,CurrencyPL,TaxPL,ProductPL">
    <apex:form >
    <apex:sectionHeader title="Invoice and Credit Memo" subtitle="{!Invoice__c.Name}"  /> 
    <apex:pageBlock title="Invoice and Credit Memo Detail" >
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}" rerender="error" />
                <apex:commandButton value="Cancel" action="{!cancel}" rerender="error" />
            </apex:pageBlockButtons>
            <apex:pageMessages ></apex:pageMessages>
        <apex:pageBlockSection title="Information" columns="2" collapsible="false">
            <apex:inputField value="{!Invoice__c.Customer__c}" required="true" />
            <apex:pageBlockSectionItem >
                <apex:outputLabel value="Currency"/>
                <apex:outputPanel layout="block" styleClass="requiredInput" >
                <apex:outputPanel layout="block" styleClass="requiredBlock"/>
                <apex:selectList value="{!Invoice__c.Currency__c}" 
                     required="True" size="1" id="invoicecurr">
                    <apex:selectOptions value="{!getCurrency}"/>
                </apex:selectList>
                </apex:outputPanel>
            </apex:pageBlockSectionItem> 
            <apex:inputField value="{!Invoice__c.Date_Document__c}" required="true" /> 
            <apex:inputField value="{!Invoice__c.Due_Date__c}" required="true" />
            <apex:inputField value="{!Invoice__c.Type__c}" required="true" />  
            
            <apex:pageBlockSectionItem >
                <apex:outputLabel value="Description"/>
                <apex:outputPanel layout="block" styleClass="requiredInput" >
                <apex:outputPanel layout="block" styleClass="requiredBlock"/>
                <apex:inputTextarea value="{!Invoice__c.Description__c}" required="true" cols="40" rows="3" /> 
                </apex:outputPanel>
            </apex:pageBlockSectionItem> 
            
        </apex:pageBlockSection>   
            <apex:pageBlockTable value="{!lines}" var="li" id="table">  
                <apex:column headerValue="Line Items" colspan="2">
                    <apex:outputLabel value="Description"/>
                    <apex:inputField value="{!li.Display_Name__c}" required="true"/>
                    <apex:outputLabel value="Amount inc Tax"/>
                    <apex:inputField value="{!li.Amount_Inc_Tax__c}" required="true"/>
                    <apex:outputLabel value="Invoice"/>
                    <apex:inputField value="{!li.Invoice__c}"/>
                    
               <apex:outputLabel value="Currency"/>
                        <apex:outputPanel layout="block" styleClass="requiredInput" >
                        <apex:outputPanel layout="block" styleClass="requiredBlock"/>
                            <apex:selectList value="{!li.Currency__c}" required="True" size="1">
                    <apex:selectOptions value="{!getCurrency}"/>
                </apex:selectList>
                </apex:outputPanel>

               <apex:outputLabel value="Product"/>
                        <apex:outputPanel layout="block" styleClass="requiredInput" >
                        <apex:outputPanel layout="block" styleClass="requiredBlock"/>
                            <apex:selectList value="{!li.Product_For_Sale__c}" required="True" size="1">
                    <apex:selectOptions value="{!getProduct}"/>
                </apex:selectList>
                </apex:outputPanel>
                
               <apex:outputLabel value="Tax"/>
                        <apex:outputPanel layout="block" styleClass="requiredInput" >
                        <apex:outputPanel layout="block" styleClass="requiredBlock"/>
                            <apex:selectList value="{!li.Tax__c}" required="True" size="1">
                    <apex:selectOptions value="{!getTax}"/>
                </apex:selectList>
                </apex:outputPanel>                
                    
                    <apex:outputLabel value="Quantity"/>
                    <apex:inputField value="{!li.Quantity__c}" required="true"/>
                                                       
                    <apex:commandLink value="Add Row" action="{!addRow}" rerender="table,error" immediate="true" />&nbsp;|&nbsp;&nbsp;
                    <apex:commandLink value="Remove Row" action="{!removeRow}" rerender="table,error" immediate="true" />
                 </apex:column>    
            </apex:pageBlockTable>   
              
    </apex:pageBlock>
    </apex:form>
</apex:page>

  classes

 

public class newInvoiceLineItems {

    public List<miiFinance__Invoice_Line_Item__c> lines {get; set;}
    private final miiFinance__Invoice__c parInv;
    public newInvoiceLineItems(ApexPages.StandardController myController) {
        parInv=(miiFinance__Invoice__c)myController.getrecord();
        lines = new List<miiFinance__Invoice_Line_Item__c>();
        miiFinance__Invoice_Line_Item__c LitOrd = new miiFinance__Invoice_Line_Item__c();
        LitOrd.miiFinance__Invoice__c = parInv.id;
        lines.add(LitOrd);}

    public void addrow() {
        miiFinance__Invoice_Line_Item__c LitOrd = new miiFinance__Invoice_Line_Item__c();
        LitOrd.miiFinance__Invoice__c = parInv.id;
        lines.add(LitOrd);}
            
    public void removerow(){
        Integer i = lines.size();
        lines.remove(i-1);}
            
    public PageReference save() {
        insert lines;
        PageReference home = new PageReference('/home/home.jsp');
        home.setRedirect(true);
        return home; }}

 

class which looksup values of picklist

 

public class ProductPL {
    private miiFinance__Invoice__c invoice;
    public ProductPL(ApexPages.StandardController controller) {
    this.invoice = (miiFinance__Invoice__c)controller.getRecord();
    }
    public List <SelectOption> getProduct {
    Get{
    List <SelectOption> product = new List <SelectOption>();
    for( miiFinance__Product_For_Sale__c pr: [select Name, miiFinance__Display_Name__c from miiFinance__Product_For_Sale__c])
    product.add(new selectOption(pr.id, pr.Name + ' - ' +  pr.miiFinance__Display_Name__c));
    return product;
    }
    Set;
    }
    }

 

 

Hi Comm.

 

This code work perfectly, however i would like my records under headervalue="Line Items" to display hosizontally, not vertically. I think it has to do with me using a column. Does anyone have a suggestion how i can restyle it?

 

Below is my VF code for my page which is using correct code for my means, but not displaying correclty. Below that is code which displays the way i want, but does not use correct code for what i want to achieve. Im trying to achieve using both versions into 1, which is hosizontal records displaying in vf1

 

<apex:page standardController="Invoice__c" extensions="newInvoiceLineItems,CurrencyPL,TaxPL,ProductPL">
    <apex:form >
    <apex:sectionHeader title="Invoice and Credit Memo Edit" subtitle="New Invoice and Credit Memo"  /> 
    <apex:pageBlock title="Invoice Details" >
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}" rerender="error" />
            </apex:pageBlockButtons>
            <apex:pageMessages ></apex:pageMessages>
        <apex:pageBlockSection title="Information" columns="2" collapsible="false">
            <apex:inputField value="{!Invoice__c.Customer__c}" required="true" />
            <apex:pageBlockSectionItem >
                <apex:outputLabel value="Currency"/>
                <apex:outputPanel layout="block" styleClass="requiredInput" >
                <apex:outputPanel layout="block" styleClass="requiredBlock"/>
                <apex:selectList value="{!Invoice__c.Currency__c}" 
                     required="True" size="1" id="invoicecurr">
                    <apex:selectOptions value="{!getCurrency}"/>
                </apex:selectList>
                </apex:outputPanel>
                </apex:pageBlockSectionItem> 
            <apex:inputField value="{!Invoice__c.Date_Document__c}" required="true" /> 
            <apex:inputField value="{!Invoice__c.Due_Date__c}" required="true" />
            <apex:inputField value="{!Invoice__c.Type__c}" required="true" />  
            <apex:inputTextarea value="{!Invoice__c.Description__c}" required="true" /> 
        </apex:pageBlockSection>   
            <apex:pageBlockTable value="{!lines}" var="li" id="table">      
                <apex:column headerValue="Line Items">
                    <apex:facet name="header">Line Items</apex:facet>           
                    <apex:outputLabel value="Currency"/>
                    <apex:inputField value="{!li.Amount_Inc_Tax__c}" required="true"/>
                    <apex:inputField value="{!li.Invoice__c}"/>
                    <apex:commandLink value="Add Row" action="{!addRow}" rerender="table,error" immediate="true" />&nbsp;|&nbsp;&nbsp;
                    <apex:commandLink value="Remove Row" action="{!removeRow}" rerender="table,error" immediate="true" />
                 </apex:column>    
            </apex:pageBlockTable>
    </apex:pageBlock>
    </apex:form>
</apex:page>

 

this displays my records the way i want, but cannot get my code to work the way i want

 

<apex:page StandardController="Invoice__c" extensions="MultiAdd,TestCurrencyPL,TaxPL,ProductPL" id="thePage">
<apex:form >
<apex:sectionHeader title="Invoice and Credit Memo Edit" subtitle="New Invoice and Credit Memo"  /> 
<apex:pageblock id="pb" >
    <apex:pageBlockButtons >
        <apex:commandbutton value="Add Line Item" action="{!Add}" rerender="pb1"/>
        <apex:commandbutton value="Save Invoice" action="{!Save}"/>
    </apex:pageBlockButtons>
    <apex:pageMessages ></apex:pageMessages>
    <apex:pageBlockSection title="Information" columns="2" collapsible="false">
        <apex:inputField value="{!Invoice__c.Customer__c}" required="true" />
                
                <apex:pageBlockSectionItem >
                <apex:outputLabel value="Currency"/>
                <apex:outputPanel layout="block" styleClass="requiredInput" >
                <apex:outputPanel layout="block" styleClass="requiredBlock"/>
                <apex:selectList value="{!Invoice__c.Currency__c}" 
                     required="True" size="1" id="invoicecurr">
                    <apex:selectOptions value="{!getCurrency}"/>
                </apex:selectList>
                </apex:outputPanel>
                </apex:pageBlockSectionItem>
        
        <apex:inputField value="{!Invoice__c.Date_Document__c}" required="true" />
        <apex:inputField value="{!Invoice__c.Type__c}" required="true" />
        <apex:inputField value="{!Invoice__c.Due_Date__c}" required="true" />  
        <apex:inputTextarea value="{!Invoice__c.Description__c}" required="true" />   
    </apex:pageBlockSection>    
        
        <apex:pageblock id="pb1">
            
        <apex:repeat value="{!lstInner}" var="e1" id="therepeat">
                <apex:panelGrid columns="9">
                
                <apex:panelGrid headerClass="Name">
                    <apex:facet name="header">&nbsp;</apex:facet>
                    <apex:commandButton value="Remove" action="{!Del}" rerender="pb1">
                        <apex:param name="rowToBeDeleted" value="{!e1.recCount}" assignTo="{!selectedRowIndex}"></apex:param>
                    </apex:commandButton>
                </apex:panelGrid>   
                
                <apex:panelGrid title="SPD" >
                    <apex:facet name="header">Display Name</apex:facet>
                    <apex:inputfield value="{!e1.acct.Display_Name__c}" required="true"/>
                </apex:panelGrid>
                
                <apex:panelGrid >
                <apex:facet name="header">Product</apex:facet>
                <apex:outputPanel layout="block" styleClass="requiredInput">
                <apex:outputPanel layout="block" styleClass="requiredBlock"/>
                <apex:selectList value="{!e1.acct.Product_For_Sale__c}" 
                     required="True" size="1" id="lineitemdisplayname">
                    <apex:selectOptions value="{!getProduct}"/>
                </apex:selectList>
                </apex:outputPanel>
                </apex:panelGrid>

                <apex:panelGrid >
                <apex:facet name="header">Tax</apex:facet>
                <apex:outputPanel layout="block" styleClass="requiredInput">
                <apex:outputPanel layout="block" styleClass="requiredBlock"/>
                <apex:selectList value="{!e1.acct.Tax__c}" 
                     required="True" size="1" id="lineitemtax">
                    <apex:selectOptions value="{!getTax}"/>
                </apex:selectList>
                </apex:outputPanel>
                </apex:panelGrid>

                <apex:panelGrid >
                <apex:facet name="header">Currency</apex:facet>
                <apex:outputPanel layout="block" styleClass="requiredInput">
                <apex:outputPanel layout="block" styleClass="requiredBlock"/>
                <apex:selectList value="{!e1.acct.Currency__c}" 
                     required="True" size="1" id="lineitemcurr">
                    <apex:selectOptions value="{!getCurrency}"/>
                </apex:selectList>
                </apex:outputPanel>
                </apex:panelGrid>
                
                <apex:panelGrid >
                    <apex:facet name="header">Quantity</apex:facet>
                    <apex:inputfield value="{!e1.acct.Quantity__c}" required="true" />
                </apex:panelGrid> 

                <apex:panelGrid >
                    <apex:facet name="header">Amount inc Tax</apex:facet>
                    <apex:inputfield value="{!e1.acct.Amount_Inc_Tax__c}" required="true" />
                </apex:panelGrid>                              
                
                <apex:panelGrid >
                    <apex:facet name="header">Invoice</apex:facet>
                    <apex:inputfield value="{!e1.acct.Invoice__c}" required="true" />
                </apex:panelGrid>                  
                
                <apex:panelGrid >
                <apex:facet name="header">&nbsp;</apex:facet>
                <apex:commandbutton value="Add Line Item" action="{!Add}" rerender="pb1"/>               
                
                </apex:panelGrid>  
                
            </apex:panelgrid>
        </apex:repeat>
    </apex:pageBlock>
</apex:pageblock>
</apex:form>
</apex:page>

 

Hello

 

I am trying to achieve a 2 step wizard for an invoice.

 

Step 1: create the invoice record and click custom "save" button

Step 2: record is saved, and user is redirected to a 2nd step page, carrying with it step 1's id within the URL

 

I cannot for the life of me get the ID of the invoice record (step 1) to carry through to step 2.

 

Is there any step by step, i have looked all over this forum. Thanks in advance

 

Here is my vf

 

<apex:page standardController="Invoice__c" extensions="CurrencyPL">
    <apex:form >
    <apex:pageBlock title="Invoice Details" >
                <apex:pageBlockButtons >
                      <apex:commandButton action="{!saveAndRedirect}" value="Save Invoice & Add Line Items"/>
                      <apex:commandButton action="{!cancel}" value="Cancel" onclick="return confirmCancel()" immediate="true"/>
                </apex:pageBlockButtons>
            <apex:pageMessages ></apex:pageMessages>
        <apex:pageBlockSection title="Information" columns="2" collapsible="false">
            <apex:inputField value="{!Invoice__c.Customer__c}" required="true" />
            <apex:pageBlockSectionItem >
                <apex:outputLabel value="Currency"/>
                <apex:outputPanel layout="block" styleClass="requiredInput" >
                <apex:outputPanel layout="block" styleClass="requiredBlock"/>
                <apex:selectList value="{!Invoice__c.Currency__c}" 
                     required="True" size="1" id="invoicecurr">
                    <apex:selectOptions value="{!getCurrency}"/>
                </apex:selectList>
                </apex:outputPanel>
                </apex:pageBlockSectionItem> 
            <apex:inputField value="{!Invoice__c.Date_Document__c}" required="true" /> 
            <apex:inputField value="{!Invoice__c.Due_Date__c}" required="true" />
            <apex:inputField value="{!Invoice__c.Type__c}" required="true" />  
            <apex:inputTextarea value="{!Invoice__c.Description__c}" required="true" /> 
        </apex:pageBlockSection>   
    </apex:pageBlock>
    </apex:form>
</apex:page>

 

here is my class

 

public class CurrencyPL {
    private miiFinance__Invoice__c invoice;
    public CurrencyPL(ApexPages.StandardController controller) {
    this.invoice = (miiFinance__Invoice__c)controller.getRecord();
    }

   public PageReference step2() {
      return Page.NewInvoicePage2;
   }

public PageReference saveAndRedirect() {
  stdCtrl.save(); // This takes care of the details for you.
  PageReference saveAndRedirectPage = Page.NewInvoicePage2; 

somewhere here place '.id'

  saveAndRedirectPage.setRedirect(true);
  return saveAndRedirectPage;
}

    public List <SelectOption> getCurrency {
    Get{
    List <SelectOption> curr = new List <SelectOption>();
    for( miiFinance__Currency__c cu: [select Name from miiFinance__Currency__c WHERE miiFinance__Active__c = TRUE])
    curr.add(new selectOption(cu.id, cu.Name));
    return curr;
    }
    Set;
    }
    }

 

 

Hello

 

I am displaying a lookup (Name) value in my pikclist value, which is a lookup to another object. I was hoping to display a different field value (not the autonumber .Name value) in the picklist value. Or perhaps a string of multiple values (Name.customfield__c). Is this possible?

 

This code gives the name (autonumber) value, but i would like to display the (miiFinance__Display_Name__c) value, and capture the Id so it saves correctly. Here is my code so far.

 

VF

 

<apex:page StandardController="Invoice__c" extensions="MultiAdd,CurrencyPL,TaxPL,ProductPL" id="thePage">
<apex:form >
<apex:pageblock id="pb" >
    <apex:pageBlockButtons >
        <apex:commandbutton value="Add Line Item" action="{!Add}" rerender="pb1"/>
        <apex:commandbutton value="Save Invoice" action="{!Save}"/>
    </apex:pageBlockButtons>
    
    <apex:pageBlockSection title="Information" columns="2" collapsible="false">
        <apex:inputField value="{!Invoice__c.Customer__c}" required="true" />


        <apex:selectList required="true" id="icurr" value="{!Invoice__c.Currency__c}" size="1">
        <apex:selectOptions value="{!getCurrency}"/>
        </apex:selectList>
        
        <apex:inputField value="{!Invoice__c.Date_Document__c}" required="true" />
        <apex:inputField value="{!Invoice__c.Type__c}" required="true" />
        <apex:inputField value="{!Invoice__c.Due_Date__c}" required="true" />    
    </apex:pageBlockSection>    
        
        
        <apex:pageblock id="pb1">
            
        <apex:repeat value="{!lstInner}" var="e1" id="therepeat">
                <apex:panelGrid columns="8">
                
                <apex:panelGrid headerClass="Name">
                    <apex:facet name="header">Delete</apex:facet>
                    <apex:commandButton value="Remove" action="{!Del}" rerender="pb1">
                        <apex:param name="rowToBeDeleted" value="{!e1.recCount}" assignTo="{!selectedRowIndex}"></apex:param>
                    </apex:commandButton>
                </apex:panelGrid>   
                
                <apex:panelGrid title="SPD" >
                    <apex:facet name="header">Display Name</apex:facet>
                    <apex:inputfield value="{!e1.acct.Display_Name__c}" required="true"/>
                </apex:panelGrid>
                
                <apex:panelGrid >
                    <apex:facet name="header">Product</apex:facet>
                    
                    <apex:selectList id="prod" value="{!e1.acct.Product_For_Sale__c}" size="1" title="Product">
                    <apex:selectOptions value="{!getProduct}"/>
                    </apex:selectList>
                    
                </apex:panelGrid>

                <apex:panelGrid >
                    <apex:facet name="header">Tax</apex:facet>
                    
                    <apex:selectList id="tax" value="{!e1.acct.Tax__c}" size="1" title="Tax">
                    <apex:selectOptions value="{!getTax}"/>
                    </apex:selectList>
                    
                </apex:panelGrid>


                <apex:panelGrid >
                    <apex:facet name="header">Currency</apex:facet>
                    
                    <apex:selectList id="curr" value="{!e1.acct.Currency__c}" size="1" title="Currency">
                    <apex:selectOptions value="{!getCurrency}"/>
                    </apex:selectList>
                    
                </apex:panelGrid>
                
                <apex:panelGrid >
                    <apex:facet name="header">Invoice</apex:facet>
                    <apex:inputfield value="{!e1.acct.Invoice__c}" required="true" />
                </apex:panelGrid>

                <apex:panelGrid >
                    <apex:facet name="header">Amount inc Tax</apex:facet>
                    <apex:inputfield value="{!e1.acct.Amount_Inc_Tax__c}" required="true" />
                </apex:panelGrid>                              
                
            </apex:panelgrid>
        </apex:repeat>
    </apex:pageBlock>
</apex:pageblock>
</apex:form>
</apex:page>

 

Here is the class which is involved. If i get this one, i can replicate the code and make it all work

 

public class ProductPL {
    private miiFinance__Invoice__c invoice;
    public ProductPL(ApexPages.StandardController controller) {
    this.invoice = (miiFinance__Invoice__c)controller.getRecord();
    }
    public List <SelectOption> getProduct {
    Get{
    List <SelectOption> product = new List <SelectOption>();
    for( miiFinance__Product_For_Sale__c pr: [select Name from miiFinance__Product_For_Sale__c])
    product.add(new selectOption(pr.id, pr.Name));
    return product;
    }
    Set;
    }
    }

  I believe the line

 

[select Name from miiFinance__Product_For_Sale__c])

 

is the issue, and when i add the custom field, i get the error 

 

System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: miiFinance__Product_For_Sale__c.Name 

 

I add that field to my query

 

    product.add(new selectOption(pr.id, pr.Name, pr.miiFinance__Display_Name__c));

 i get this error

 

Error: ProductPL Compile Error: Constructor not defined: [System.SelectOption].<Constructor>(Id, String, String) at line 10 column 17

 

Line 10 is the code above

 

Please let me know your thoughts

 

Dave

 


Hello

 

I am trying to achieve having this parent record (miiFinance__Invoice__c) save. My code is not quite finished, however this is my first hurdle. I reused this code when creating multiple account records from the one page, so thats why some reference to acct is in there.

 

My outcome is to have this invoice__c record save and have the related miiFinance__Invoice_Line_Item__c records relate and save also. This code works if i manually look up and already saved invoice. How can i

 

1. pass the future/new ID of ths miiFinance__Invoice__c record into the newly, to be created, miiFinance__Invoice_Line_Item__c records?

2. have the parent miiFinance__Invoice__c record save to the database upon saving the record?

 

Thank you in advance

 

Here is my VF page

 

<apex:page StandardController="Invoice__c" extensions="MultiAdd" id="thePage">
<apex:form >
<apex:pageblock id="pb" >
    <apex:pageBlockButtons >
        <apex:commandbutton value="Add Line Item" action="{!Add}" rerender="pb1"/>
        <apex:commandbutton value="Save Invoice" action="{!Save}"/>
    </apex:pageBlockButtons>
    
    <apex:pageBlockSection title="Information" columns="2" collapsible="false">
        <apex:inputField value="{!Invoice__c.Customer__c}" required="true" />
        <apex:inputField value="{!Invoice__c.Currency__c}" required="true" />
        <apex:inputField value="{!Invoice__c.Date_Document__c}" required="true" />
        <apex:inputField value="{!Invoice__c.Type__c}" required="true" />
        <apex:inputField value="{!Invoice__c.Due_Date__c}" required="true" />    
    </apex:pageBlockSection>    
        
        
        <apex:pageblock id="pb1">
            
        <apex:repeat value="{!lstInner}" var="e1" id="therepeat">
                <apex:panelGrid columns="8">
                
                <apex:panelGrid headerClass="Name">
                    <apex:facet name="header">Delete</apex:facet>
                    <apex:commandButton value="Remove" action="{!Del}" rerender="pb1">
                        <apex:param name="rowToBeDeleted" value="{!e1.recCount}" assignTo="{!selectedRowIndex}"></apex:param>
                    </apex:commandButton>
                </apex:panelGrid>   
                
                <apex:panelGrid title="SPD" >
                    <apex:facet name="header">Display Name</apex:facet>
                    <apex:inputfield value="{!e1.acct.Display_Name__c}" required="true"/>
                </apex:panelGrid>
                
                <apex:panelGrid >
                    <apex:facet name="header">Product</apex:facet>
                    <apex:inputfield value="{!e1.acct.Product_For_Sale__c}" required="true"/>
                </apex:panelGrid>
                
                <apex:panelGrid >
                    <apex:facet name="header">Currency</apex:facet>
                    <apex:inputfield value="{!e1.acct.Currency__c}" required="true"/>
                </apex:panelGrid>
                
                <apex:panelGrid >
                    <apex:facet name="header">Tax Type</apex:facet>
                    <apex:inputfield value="{!e1.acct.Tax__c}" required="true"/>
                </apex:panelGrid>

                <apex:panelGrid >
                    <apex:facet name="header">Quantity</apex:facet>
                    <apex:inputfield value="{!e1.acct.Amount_Inc_Tax__c}" required="true" />
                </apex:panelGrid>
                
                <apex:panelGrid >
                    <apex:facet name="header">Invoice</apex:facet>
                    <apex:inputfield value="{!e1.acct.Invoice__c}" required="true" />
                </apex:panelGrid>

                <apex:panelGrid >
                    <apex:facet name="header">Amount</apex:facet>
                    <apex:inputfield value="{!e1.acct.Amount_Inc_Tax__c}" required="true" />
                </apex:panelGrid>                              
                
            </apex:panelgrid>
        </apex:repeat>
    </apex:pageBlock>
</apex:pageblock>
</apex:form>
</apex:page>

 

Here is my extension

 

public class MultiAdd
{
    
    //will hold the account records to be saved
    public List<miiFinance__Invoice_Line_Item__c>lstAcct  = new List<miiFinance__Invoice_Line_Item__c>();
    
    //list of the inner class
    public List<innerClass> lstInner 
    {   get;set;    }
    
    //will indicate the row to be deleted
    public String selectedRowIndex
    {get;set;}  
    
    //no. of rows added/records in the inner class list
    public Integer count = 1;
    //{get;set;}
    
    
    ////save the records by adding the elements in the inner class list to lstAcct,return to the same page
    public PageReference Save()
    {
        PageReference pr = new PageReference('/apex/MultiAdd');
        
        for(Integer j = 0;j<lstInner.size();j++)
        {
            lstAcct.add(lstInner[j].acct);
        } 
        insert lstAcct;
        pr.setRedirect(True);
        return pr;
    }
        
    //add one more row
    public void Add()
    {   
        count = count+1;
        addMore();      
    }
    
    /*Begin addMore*/
    public void addMore()
    {
        //call to the iner class constructor
        innerClass objInnerClass = new innerClass(count);
        
        //add the record to the inner class list
        lstInner.add(objInnerClass);    
        system.debug('lstInner---->'+lstInner);            
    }/* end addMore*/
    
    /* begin delete */
    public void Del()
    {
        system.debug('selected row index---->'+selectedRowIndex);
        lstInner.remove(Integer.valueOf(selectedRowIndex)-1);
        count = count - 1;
        
    }/*End del*/
    
    
    
    /*Constructor*/
    public MultiAdd(ApexPages.StandardController ctlr)
    {
    
        lstInner = new List<innerClass>();
        addMore();
        selectedRowIndex = '0';
        
    }/*End Constructor*/
        


    /*Inner Class*/
    public class innerClass
    {       
        /*recCount acts as a index for a row. This will be helpful to identify the row to be deleted */
        public String recCount
        {get;set;}
        
        
        public miiFinance__Invoice_Line_Item__c acct 
        {get;set;}
        
        /*Inner Class Constructor*/
        public innerClass(Integer intCount)
        {
            recCount = String.valueOf(intCount);        
            
            /*create a new account*/
            acct = new miiFinance__Invoice_Line_Item__c();
            
        }/*End Inner class Constructor*/    
    }/*End inner Class*/
}/*End Class*/

 


Hello

 

I am trying to write a test class within this apex class. I have used it before but for some reason this time it is not working. Any ideas?

 

My error is

 

Error: InvoiceCloneWithItemsController Compile Error: Method does not exist or incorrect signature: [InvoiceCloneWithItemsController].getInvoiceCloneWithItemsController() at line 68 column 5

 

public class InvoiceCloneWithItemsController {
 
    //added an instance varaible for the standard controller
    private ApexPages.StandardController controller {get; set;}
     // add the instance for the variables being passed by id on the url
    private miiFinance__Invoice__c po {get;set;}
    // set the id of the record that is created -- ONLY USED BY THE TEST CLASS
    public ID newRecordId {get;set;}
 
    // initialize the controller
    public InvoiceCloneWithItemsController(ApexPages.StandardController controller) {
 
        //initialize the stanrdard controller
        this.controller = controller;
        // load the current record
        po = (miiFinance__Invoice__c)controller.getRecord();
 
    }
 
    // method called from the VF's action attribute to clone the po
    public PageReference cloneWithItems() {
 
         // setup the save point for rollback
         Savepoint sp = Database.setSavepoint();
         miiFinance__Invoice__c newPO;
 
         try {
 
              //copy the purchase order - ONLY INCLUDE THE FIELDS YOU WANT TO CLONE
             po = [select Id, Name, miiFinance__Customer__c, Charged_To_Credit_Card__c, miiFinance__Company_Name__c, miiFinance__Currency__c, miiFinance__Description__c, miiFinance__Due_Date__c, Payment_Allocation__c, miiFinance__Type__c from miiFinance__Invoice__c where id = :po.id];
             newPO = po.clone(false);
             insert newPO;
 
             // set the id of the new po created for testing
               newRecordId = newPO.id;
 
             // copy over the line items - ONLY INCLUDE THE FIELDS YOU WANT TO CLONE
             List<miiFinance__Invoice_Line_Item__c> items = new List<miiFinance__Invoice_Line_Item__c>();
             for (miiFinance__Invoice_Line_Item__c pi : [Select p.Id, p.Name, miiFinance__Amount_Inc_Tax__c, Billed_From_Subscription__c, miiFinance__Currency__c, miiFinance__Display_Name__c, miiFinance__Product_For_Sale__c, miiFinance__Quantity__c, miiFinance__Tax__c, Tax_Amount_Dollars__c From miiFinance__Invoice_Line_Item__c p where miiFinance__Invoice__c = :po.id]) {
                  miiFinance__Invoice_Line_Item__c newPI = pi.clone(false);
                  newPI.miiFinance__Invoice__c = newPO.id;
                  items.add(newPI);
             }
             insert items;
 
         } catch (Exception e){
             // roll everything back in case of error
            Database.rollback(sp);
            ApexPages.addMessages(e);
            return null;
         }
 
        return new PageReference('/'+newPO.id+'/e?retURL=%2F'+newPO.id);
    }

 public static testmethod void Test1()

    {

    miiFinance__Invoice__c p=new miiFinance__Invoice__c();

    ApexPages.StandardController sc = new ApexPages.standardController(p);

           

    InvoiceCloneWithItemsController po=new InvoiceCloneWithItemsController (sc);

    po.getInvoiceCloneWithItemsController();

    }     
 
}

 

here is my vf page

 

<apex:page standardController="miiFinance__Invoice__c"
     extensions="InvoiceCloneWithItemsController"
     action="{!cloneWithItems}">
     <apex:pageMessages />
</apex:page>

 

 

 

Our Force.com for Amazon Web Services no longer has its associated APEX Classes marked as Active

When we try connect to the object in SF, we get these errors

Apex class 'AWS_S3_ExampleController' does not exist

I have checked the classes and they are all marked "Inactive"

How can I make these classes "Active". I did not deactivate them.

I can login to the AWS via their AWS website.

I raised a case with Salesforce and they no longer support "development" questions under my enterprise support agreement.

 

Has anyone had this happen, know how to make them active again, or an idea how i can restore it (reinstall?)

 

Regards

David

Hello

 

Can someone please tell me where i am going wrong with this code? The saveURL is simly not being executed, and the record stays on the newly created record after save. If you cancel, yes, it does revert back to the parent, but the save ALWAYS stays on the child, where i would like it to go back to the parent (ticket is the parent, ticket comment is the child)

 

/apex/AddComment?CF00N90000002Fdf1={!miiHelpDeskT2__Ticket__c.Name}&CF00N90000002Fdf1_lkid={!miiHelpDeskT2__Ticket__c.Id}&CF00N90000002Fdf8{!miiHelpDeskT2__Ticket__c.miiHelpDeskT2__Ticket_Manager_Name__c}&CF00N90000002Fdf8_lkid={!miiHelpDeskT2__Ticket__c.miiHelpDeskT2__Ticket_Manager_NameId__c}&CF00N90000002zw4A_lkid={!miiHelpDeskT2__Ticket__c.miiHelpDeskT2__Subject__c}&CF00N90000002zw4F_lkid={!miiHelpDeskT2__Ticket__c.miiHelpDeskT2__Description__c}&sfdc.override=1&retURL=%2F{!miiHelpDeskT2__Ticket__c.Id}&saveURL=%2F{!miiHelpDeskT2__Ticket__c.Id}

 

Its worth mentioning that without the below part, the whole custom button does not work

 

&sfdc.override=1

Hello

 

I am trying to create a visualforce page/button to have the ability to change the master record on a master detail related record, after the initial save

 

The standard interface does not allow for this to occur, however i know it can be achieved via API/intercept back into the database.

 

Does anyone have any ideas how i can achieve this is Visualforce? My thoughts would be to create a visualforce button, which pops up and then the user can select another record (name) to relate, and upon save, commits that back to the database and makes the change

 

Any ideas? Im really stuck? The package being used is a managed package (which i made, and since deployment, cannot make the core package change back to a standard lookup field from a master/detail lookup)


Regards

 

David

Hello

 

I have created a custom object (Ticket) and i autonumber the name field TNXXXXXXX.

 

I am at ticket number TN0003253

 

I can search on exactly "TN0003253" and i get a result, but when i search on "3253" i get no results. OPnbiously you ask the customer for their number, and dont want to type in the TN or the zeros.

 

I have tried creating another custom field, making it externalID, and workflowing the value in, but this does not seem to work either. I have added my new custom field (Tickey Number Search) into the search results on the object. No go.

 

Does anyone have any ideas how you can search partially on a autonumber name field type?

 

My other idea was to create a field, and then take the right 4 characters and place it in there, but this is not scalable once it his 5 characters on the right.

 

Thanks


David

Hello. I am making a 'feed' type visualforce page for my home dashboard, and i am displaying the most recent 5 records. Within those records, there is a richtext type field, which is the "Comment". I am trying to only display the first 5 rows of the field data (not the whole field as the info can get to long and stretch the page). Is there a way to limit the number of rows/characters which display on a richtext field type. I know i can do it on a standard text field, but not a richtext? The field is

 

value="{!t.miiHelpDeskT2__Comment__c}" 

 

Thanks in advance

 

Here is my VF

 

<apex:page standardController="miiHelpDeskT2__Ticket__c" showheader="false" sidebar="false" extensions="TicketCommentFeedList">
<html>
<style type="text/css">
a:link    {
  /* Applies to all unvisited links */
  text-decoration:  none;
  font-weight:      bold;
  color:            blue;
  } 
a:visited {
  /* Applies to all visited links */
  text-decoration:  none;
  font-weight:      bold;
  color:            #f0f;
  } 
a:hover   {
  /* Applies to links under the pointer */
  text-decoration:  underline;
  font-weight:      bold;
  color:            #fff;
  } 
a:active  {
  /* Applies to activated links */
  text-decoration:  underline;
  font-weight:      bold;
  color: white;
  } 
.ticket {font-family:arial,Georgia,Serif; font-size: 12px; font-weight:bold; color:#6699CC}
</style>
  <apex:repeat value="{!TicketCommentFeedList}" var="t" rows="5">
      <table width="100%" border="1" cellpadding="5">
      <tr>
        <td>
        <a href="https://ap1.salesforce.com/{!t.miiHelpDeskT2__Ticket__c}" target="_parent">
        <apex:outputText styleClass="ticket" value="{!t.miiHelpDeskT2__Ticket_Number__c}"/>
        </a>&nbsp;:&nbsp;
        <apex:outputText style="font-size:11px;" value="{!t.miiHelpDeskT2__Subject__c}"/>&nbsp;:&nbsp;
        <apex:outputText style="font-size:11px;" value="{!t.Contact_Who_Made_Comment_Name__c}" escape="false"/>&nbsp;@&nbsp;<apex:outputText style="font-size:11px;" value=" {!t.miiHelpDeskT2__Created_Date_Time__c}"></apex:outputText><br></br><br></br><apex:outputText style="font-size:11px;" value="{!t.miiHelpDeskT2__Comment__c}" escape="false"/>
        
        </td>
      </tr>
      </table> 
  </apex:repeat> 
</html>   
</apex:page>

 

Here is my class

 

public class TicketCommentFeedList {

    private ApexPages.StandardController stdCtrl;
    
    public TicketCommentFeedList(ApexPages.StandardController controller)

    {

        stdCtrl=controller;

    }

    List<miiHelpDeskT2__Ticket_Comment__c> myList;

    Public List<miiHelpDeskT2__Ticket_Comment__c> getTicketCommentFeedList() {

myList = [SELECT Id, Name, miiHelpDeskT2__Ticket__c, miiHelpDeskT2__Active__c, miiHelpDeskT2__Comment__c, miiHelpDeskT2__Contact_Name__c, miiHelpDeskT2__Contact_Who_Made_Comment_Email__c, miiHelpDeskT2__Contact_Who_Made_Comment__c, miiHelpDeskT2__Created_Date_Time__c, miiHelpDeskT2__Is_Member_Comment__c, miiHelpDeskT2__Is_Ticket_Answered__c, miiHelpDeskT2__Public__c, miiHelpDeskT2__Send_Customer_Notification__c, miiHelpDeskT2__Subject__c, miiHelpDeskT2__Ticket_Manager_Email__c, miiHelpDeskT2__Ticket_Manager_Name__c, miiHelpDeskT2__Ticket_Number__c, miiHelpDeskT2__ID_Historic__c, Ticket_Comment_Name_Historic__c, Ticket_Subject__c, Ticket_Description__c, Contact_First_Name__c, Contact_Who_Made_Comment_Name__c FROM miiHelpDeskT2__Ticket_Comment__c WHERE miiHelpDeskT2__Active__c = True ORDER BY miiHelpDeskT2__Created_Date_Time__c DESC ];

    /// ORDER BY CAN BE ASC OR DESC 

    return  myList;

    }

    public static testmethod void Test1()

    {

    Project_Cost__c p=new Project_Cost__c();

    ApexPages.StandardController sc = new ApexPages.standardController(p);

           

    TicketCommentFeedList Tcfl=new TicketCommentFeedList (sc);

    Tcfl.getTicketCommentFeedList();

    }     

}

 

Hello Community

 

I am trying to use a class to draw records from a child of the parent, but im returning ALL the records for the object, just not those related to that recordID. My extensions should only return records that are related to the parentID. I believe it has something to do with my WHERE statement and getID but im very new. Thanks in advance

 

Here is my VF Page

 

<apex:page showHeader="false" standardController="miiProject__Project__c" extensions="OngoingCostsList,SetupCostsList,TaskList,MilestoneList">
<html>
<head>
  <style> 
     body {font-family: Arial Unicode MS;}
     .companyName {font-weight:bold;font-size:22px;color:red} 
     .projectplan {font-family: Arial, Helvetica, sans-serif;font-size: 22px;} 
     .projectdetails {font-family: Arial, Helvetica, sans-serif;font-size: 12px;} 
     .body {font-family: Arial, Helvetica, sans-serif;font-size: 10px; vertical-align:top; text-align:top; } 
     .total {font-family: Arial, Helvetica, sans-serif;font-size: 10px; vertical-align:middle; text-align:middle; } 
     .headerbackgroundblue {font-family: Arial, Helvetica, sans-serif;font-size: 12px;background-color:#003399;color: #FFFFFF;font-weight:bold;}
     .headerbackgroundgrey {font-family: Arial, Helvetica, sans-serif;font-size: 11px;background-color:#EFEFEF;color: #000000;font-weight:bold;}
     .headerbackgroundorange {font-family: Arial, Helvetica, sans-serif;font-size: 12px;background-color:#FFC993;color: #000000;font-weight:bold;}
     .headerbackgroundgreen {font-family: Arial, Helvetica, sans-serif;font-size: 12px;background-color:#DFFFE1;color: #000000;font-weight:bold;}
     .bordersolid {border:black solid 1px; font-family: Arial, Helvetica, sans-serif;font-size: 10px; vertical-align:middle; text-align:middle;  } 

@page {
    @bottom-center { content:"Page " counter(page) " - Commercial in Confidence - miiForce Pty Ltd | www.miiworks.com";
    margin-left: 3cm;
    margin-right: 3cm;
    font-family: Arial, Helvetica, sans-serif;font-size: 10px;
  }
      }
  </style>
</head>
<table width="100%" border="0" cellpadding="5">
  <tr>
    <td><div align="center">
    <apex:image value="{!$Resource.miiworks177120}" width="177" height="120"/></div></td>
  </tr>
  <tr>
    <td><div align="center" class="projectplan">Project Plan</div></td>
  </tr>
</table>
<br></br>
<table width="40%" border="0" align="center" cellpadding="5">
  <tr>
    <td class="body">Company:</td>
    <td class="body"><strong><apex:outputField value=" {!miiProject__Project__c.Account_Name_Text__c}"/></strong></td>
  </tr>
  <tr>
    <td class="body">Document Owner:</td>
    <td class="body"><strong>miiWorks Pty Ltd</strong></td>
  </tr>
  <tr>
    <td class="body">Start Date:</td>
    <td class="body"><strong><apex:outputField value="{!miiProject__Project__c.miiProject__Date_Project_Start__c}"/></strong></td>
  </tr>
  <tr>
    <td class="body">End Date:</td>
    <td class="body"><strong><apex:outputField value="{!miiProject__Project__c.miiProject__Date_Project_End__c}"/></strong></td>
  </tr>
  <tr>
    <td class="body">Version:</td>
    <td class="body"><strong><apex:outputField value="{!miiProject__Project__c.Version__c}"/></strong></td>
  </tr>  
</table>
<br></br>
<table width="40%" border="0" align="center" cellpadding="5">
  <tr>
    <td class="body">Summary:</td>
    <td class="body"><strong><apex:outputField value="{!miiProject__Project__c.miiProject__Subject__c}"/></strong></td>
  </tr>
  <tr>
    <td class="body">Description:</td>
    <td class="body"><apex:outputField value="{!miiProject__Project__c.miiProject__Description__c}"/></td>
  </tr>
</table>

<br></br><br></br>
    
   <apex:outputPanel >
<table border="1" cellpadding="5" width="75%" align="center" valign="top"> 
     <tr>
       <td class="headerbackgroundblue">AREA MANAGERS / RESPONSIBILITIES</td>
     </tr>  
    <apex:dataTable value="{!miiProject__Project__c.Project_Contacts__r}" var="c" cellpadding="5" border="1" width="75%" rows="4" align="center">
       <apex:column headerClass="headerbackgroundgrey" headerValue="Name" value="{!c.Contact_Text__c}" width="100px" styleClass="body" />
       <apex:column headerClass="headerbackgroundgrey" headerValue="Company" value="{!c.Account_Name__c}" styleClass="body"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Role" value="{!c.Role__c}" styleClass="body"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Responsibilities" value="{!c.Responsibilities__c}" styleClass="body" />
    </apex:dataTable>
</table> 
&nbsp;
   <table border="1" cellpadding="5" width="75%" align="center">
     <tr>
       <td class="headerbackgroundblue">GUIDELINES</td>
     </tr>
     <tr>
       <td styleClass="body"><br></br>
         <strong class="body">1. EXECUTION OF  MILESTONES</strong><br></br>
         <span class="body">The project execution must be  completed in the explicit order of the milestones to achieve project success.</span>
         &nbsp;<br></br><br></br>
         <strong class="body">2. OVERDUE TASKS</strong><br></br>
         <span class="body">If a task falls overdue, the person responsible  for the task should make every effort to complete the task in a timely manner  or propose a new completion date to the project team members.</span>
         &nbsp;<br></br><br></br>
         <strong class="body">3. PROJECT FAILURE</strong><br></br>
         <span class="body">If a milestone has not been reached  by its due date due to one or many overdue tasks, the project will fall into  alert status and a priority team meeting will be called to discuss the  milestone and overdue tasks.</span>
         &nbsp;<br></br>
         <span class="body">
         The project manager reserves the  right to re-allocate the task to another team member to complete the task or  freeze the project if there is a lack of commitment and/or resources from the  team member.</span>
         &nbsp;<br></br><br></br>
         <strong class="body">4. LOCALE</strong><br></br>
         <span class="body">Please take note:</span>
         <p><ul>
           <span class="body">Date Format: dd/mm/yy (please note that long  date format may be used)</span>
         </ul>
         <ul>
           <span class="body">Language of Document: English (British)</span>
         </ul></p>
           <strong class="body">5. TERMINOLOGY</strong><br></br>
           <span class="body">UAT – User Acceptance  Testing</span></td>
     </tr>
   </table>
   <br></br>
   </apex:outputPanel> 
<table border="1" cellpadding="5" width="75%" align="center"> 
     <tr>
       <td class="headerbackgroundblue">MILESTONES</td>
     </tr>  
 <apex:dataTable value="{!MilestoneList}" var="m" cellpadding="5" border="1" width="75%" align="center">
       <apex:column headerClass="headerbackgroundgrey" headerValue="Milestone" value="{!m.miiProject__Subject__c}" styleClass="body"/> 
       <apex:column headerClass="headerbackgroundgrey" width="65px" headerValue="Due Date" value="{!m.miiProject__Date_Due__c}" styleClass="body"/>
       <apex:column headerClass="headerbackgroundgrey" width="90px" headerValue="Signed Off Date" value="{!m.Date_Signed_Off__c}" styleClass="body"/>
       <apex:column headerClass="headerbackgroundgrey" width="90px" headerValue="Completed Date" value="{!m.miiProject__Date_Time_Completed__c}" styleClass="body"/>
       <apex:column headerClass="headerbackgroundgrey" width="65px" headerValue="Signed Off?" styleClass="body" >
       <apex:outputText value="{!m.Signed_Off__c}" escape="false"/>
       </apex:column>
   </apex:dataTable>
</table>
<br></br>
<table border="1" cellpadding="5" width="75%" align="center"> 
     <tr>
       <td class="headerbackgroundblue">TASKS</td>
     </tr>
 <apex:dataTable value="{!TaskList}" var="t" cellpadding="5" border="1" width="75%" align="center">
       <apex:column headerClass="headerbackgroundgrey" headerValue="Milestone" value="{!t.Milestone_Subject__c}" styleClass="body"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Task" value="{!t.miiProject__Subject__c}" styleClass="body"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Detail">
           <apex:outputText value="{!t.miiProject__Description__c}" style="body" styleClass="body" escape="false"/>
       </apex:column>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Who" value="{!t.Assigned_To_Text__c}" styleClass="body"/>
       <apex:column headerClass="headerbackgroundgrey" width="65px" headerValue="Due Date" value="{!t.miiProject__Date_Due__c}" styleClass="body"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Status" styleClass="body">
       <apex:outputText value="{!t.Status_Image__c}" escape="false"/>
       </apex:column>
 </apex:dataTable>
</table> 
<br></br>
<table border="1" cellpadding="5" width="75%" align="center"> 
     <tr>
       <td class="headerbackgroundblue">RISK/ENHACEMENT ANALYSIS LOG</td>
     </tr>  
   <apex:dataTable value="{!miiProject__Project__c.Project_Risks_Enhancments__r}" var="ri" cellpadding="5" border="1" width="75%" align="center" >            
       <apex:column headerClass="headerbackgroundgrey" headerValue="ID" value="{!ri.Name}" styleClass="body"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Nature" value="{!ri.Subject__c}" styleClass="body"/>  
       <apex:column headerClass="headerbackgroundgrey" headerValue="Description Of Requirements" value="{!ri.Description__c}" styleClass="body"/>  
       <apex:column headerClass="headerbackgroundgrey" headerValue="Status" value="{!ri.Status__c}" styleClass="body"/>
   </apex:dataTable>  
</table> 
<br></br>
<table border="1" cellpadding="5" width="75%" align="center"> 
     <tr>
       <td class="headerbackgroundblue">APPENDICES</td>
     </tr>  
   <apex:dataTable value="{!miiProject__Project__c.Project_Appendixs__r}" var="ap" cellpadding="5" border="1" width="75%" align="center" >            
       <tr>
       <apex:column headerClass="headerbackgroundgrey" headerValue="ID" value="{!ap.Name} - {!ap.Subject__c}" styleClass="body"/><br></br>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Description" value="{!ap.Description__c}" styleClass="body"/>  
       </tr>
   </apex:dataTable>  
</table>
<br></br>
<table border="1" cellpadding="5" width="75%" align="center"> 
     <tr>
       <td class="headerbackgroundorange">SETUP COSTS</td>
     </tr>  
   <apex:dataTable value="{!SetupCostsList}" var="cose" cellpadding="5" border="1" width="75%" align="center" >            
       <tr>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Description" value="{!cose.Description__c}" styleClass="body"/>  
       <apex:column width="90" headerClass="headerbackgroundgrey" headerValue="Cost Per Hour" value="{!cose.Amount_Per_Hour__c}" styleClass="body"/>  
       <apex:column width="90" headerClass="headerbackgroundgrey" headerValue="Hour(s)" value="{!cose.Hours__c}" styleClass="body"/> 
       <apex:column width="90" headerClass="headerbackgroundgrey" headerValue="Setup Cost" value="{!cose.Cost_Total__c}" styleClass="body"/>   
       </tr> 
   </apex:dataTable> 
   <table cellpadding="5" width="75%" align="center">
       <td valign="top" styleClass="body"><img src="https://ap1.salesforce.com/resource/1330407794000/exclamation"></img><strong class="body">All Prices Exclude GST</strong></td>
       <td width="90" align="left"><strong class="total">Totals:</strong></td>
       <td width="90" align="left" class="bordersolid"><strong><apex:outputField value="{!miiProject__Project__c.Hours_Setup_Total__c}" styleClass="total"/></strong></td>
       <td width="90" align="left" class="bordersolid"><strong><apex:outputField value="{!miiProject__Project__c.Total_Costs_Setup__c}" styleClass="total"/></strong></td>
   </table>
</table> 
<br></br>
<table border="1" cellpadding="5" width="75%" align="center"> 
     <tr>
       <td class="headerbackgroundorange">ONGOING COSTS</td>
     </tr>  
   <apex:dataTable value="{!OngoingCostsList}" var="coon" cellpadding="5" border="1" width="75%" align="center">           
       <tr>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Product" value="{!coon.Product_Name__c}" styleClass="body"/><br></br>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Description" value="{!coon.Description__c}" styleClass="body"/>
       <apex:column width="90" headerClass="headerbackgroundgrey" headerValue="# Users" value="{!coon.Number_Of_Users__c}" styleClass="body"/>  
       <apex:column width="90" headerClass="headerbackgroundgrey" headerValue="$ Per User" value="{!coon.Amount_Per_User__c}" styleClass="body"/>
       <apex:column width="90" headerClass="headerbackgroundgrey" headerValue="Total/Month" value="{!coon.Cost_Total__c}" styleClass="body"/>  
       </tr>
   </apex:dataTable>
   <table cellpadding="5" border="0" width="75%" align="center">
       <td valign="top" styleClass="body"><img src="https://ap1.salesforce.com/resource/1330407794000/exclamation"></img><strong class="body">All Prices Exclude GST</strong></td>
       <td width="90" align="left" styleClass="body"></td>
       <td width="90" align="left" styleClass="body"><strong class="total">Totals:</strong></td>
       <td width="90" align="left" class="bordersolid"><strong><apex:outputField value="{!miiProject__Project__c.Total_Costs_Ongoing__c}" styleClass="total"/></strong></td>
   </table> 
<br></br>
<table border="1" cellpadding="5" width="75%" align="center"> 
     <tr>
       <td class="headerbackgroundgreen"><img src="https://ap1.salesforce.com/resource/1330407553000/greentick"></img>ACCEPTANCE</td>
     </tr>    
     <tr>
       <td><br></br>
         <strong class="body">Project Plan Acceptance: I agree that the information above is a complete and accurate</strong><br></br><br></br>
         <span class="body">The project execution must be  completed in the explicit order of the milestones to achieve project success.</span><br>
         </br><br></br><br></br>
         <br></br>
         <strong class="body">Client Signature: ________________________________________</strong><br></br><br></br>
         <br></br><br></br>
         <strong class="body">Client Full Name: ________________________________________</strong><br></br><br></br>
         <br></br>
         <strong class="body">Client Company Name: <strong><apex:outputField value=" {!miiProject__Project__c.Account_Name_Text__c}"/></strong></strong><br></br><br></br>
         <br></br>
         <strong class="body">Date: ________________________________________</strong><br></br><br></br>       </td>  
     </tr>
   </table>  
</table>   
</html> 
</apex:page>

 

Here is 1 of my classes (I can make changes when i understand methadology)

 

public class TaskList {

    public TaskList(ApexPages.StandardController controller)

    {

    }

    List<miiProject__Project_Task__c> myList;

    Public List<miiProject__Project_Task__c> getTaskList() {

myList = [SELECT Id, IsDeleted, Name, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, miiProject__Project_Milestone__c, miiProject__Account_Name_ID__c, miiProject__Account_Name__c, miiProject__Active__c, miiProject__Actual_Hours__c, miiProject__Alert_Assigned_To__c, miiProject__Assigned_To_Client__c, miiProject__Assigned_To_Email__c, miiProject__Assigned_To__c, miiProject__Contact_Email__c, miiProject__Contact_Name__c, miiProject__Date_Due__c, miiProject__Date_Time_Completed__c, miiProject__Date_Time_Started__c, miiProject__Description__c, miiProject__Internal_Comments__c, miiProject__Is_Closed__c, miiProject__Project_Manager_Email__c, miiProject__Project_Manager_Name__c, miiProject__Public__c, miiProject__Status__c, miiProject__Subject__c, ID_Historic__c, Date_Created_Historic__c, Project__c, Milestone_Subject__c, Status_Image__c, Assigned_To_Text__c FROM miiProject__Project_Task__c ORDER BY miiProject__Date_Due__c ASC ];

    /// ORDER BY CAN BE ASC OR DESC 

    return  myList;

    }

    public static testmethod void Test1()

    {

    miiProject__Project_Task__c p=new miiProject__Project_Task__c();

    ApexPages.StandardController sc = new ApexPages.standardController(p);

           

    TaskList Tas=new TaskList (sc);

    Tas.getTaskList();

    }     

}

 

 

 

 

Hello

 

I am new to Apex and just starting to learn it, so I would appreciate any help here.

 

I was informed the class needs to pass 75% before i can depoly it to my production org

 

Can anyone help me write a Test Class for this? The page is simply querying some related records with a IF filter criteria

 

Here is my page

 

<apex:page showHeader="false" standardController="miiProject__Project__c" extensions="OngoingCostsList,SetupCostsList">
<html>
<head>
  <style> 
     body {font-family: Arial Unicode MS;}
     .companyName {font-weight:bold;font-size:30px;color:red} 
     .projectplan {font-family: Arial, Helvetica, sans-serif;font-size: 36px;} 
     .projectdetails {font-family: Arial, Helvetica, sans-serif;font-size: 18px;} 
     .body {font-family: Arial, Helvetica, sans-serif;font-size: 14px; vertical-align:top; text-align:top; } 
     .headerbackgroundblue {font-family: Arial, Helvetica, sans-serif;font-size: 22px;background-color:#003399;color: #FFFFFF;font-weight:bold;}
     .headerbackgroundgrey {font-family: Arial, Helvetica, sans-serif;font-size: 14px;background-color:#EFEFEF;color: #000000;font-weight:bold;}
     .headerbackgroundorange {font-family: Arial, Helvetica, sans-serif;font-size: 22px;background-color:#FFC993;color: #000000;font-weight:bold;}
  </style>
</head>
<table width="100%" border="0" cellpadding="5">
  <tr>
    <td><div align="center"><img src="http://www.miiworks.com/images/miiworks-177x120.png" width="177" height="120"></img></div></td>
  </tr>
  <tr>
    <td><div align="center" class="projectplan">Project Plan</div></td>
  </tr>
</table>
<br></br>
<table width="20%" border="0" align="center" cellpadding="5">
  <tr>
    <td class="body">Company:</td>
    <td class="body"><strong><apex:outputField value=" {!miiProject__Project__c.miiProject__Account_Name__c}"/></strong></td>
  </tr>
  <tr>
    <td class="body">Document Owner:</td>
    <td class="body"><strong>miiWorks Pty Ltd</strong></td>
  </tr>
  <tr>
    <td class="body">Start Date:</td>
    <td class="body"><strong><apex:outputField value="{!miiProject__Project__c.miiProject__Date_Project_Start__c}"/></strong></td>
  </tr>
  <tr>
    <td class="body">End Date:</td>
    <td class="body"><strong><apex:outputField value="{!miiProject__Project__c.miiProject__Date_Project_End__c}"/></strong></td>
  </tr>
</table>
<br></br>
<table width="20%" border="0" align="center" cellpadding="5">
  <tr>
    <td class="body">Summary:</td>
    <td class="body"><strong><apex:outputField value="{!miiProject__Project__c.miiProject__Subject__c}"/></strong></td>
  </tr>
  <tr>
    <td class="body">Description:</td>
    <td class="body"><apex:outputField value="{!miiProject__Project__c.miiProject__Description__c}"/></td>
  </tr>
</table>

<br></br><br></br>
    
   <apex:outputPanel >
<table border="1" cellpadding="5" width="75%" align="center" valign="top"> 
     <tr>
       <td class="headerbackgroundblue">AREA MANAGERS / RESPONSIBILITIES</td>
     </tr>  
    <apex:dataTable value="{!miiProject__Project__c.Project_Contacts__r}" var="c" cellpadding="5" border="1" width="75%" rows="4" align="center">
       <apex:column headerClass="headerbackgroundgrey" headerValue="Name" value="{!c.Contact__c}" width="100px"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Company" value="{!c.Account_Name__c}"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Role" value="{!c.Role__c}"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Responsibilities" value="{!c.Responsibilities__c}"/>
    </apex:dataTable>
</table> 
&nbsp;

   <table border="1" cellpadding="5" width="75%" align="center">
     <tr>
       <td class="headerbackgroundblue">GUIDELINES</td>
     </tr>
     <tr>
       <td><br></br>
         <strong class="body">1. EXECUTION OF  MILESTONES</strong><br></br><br></br>
         The project execution must be  completed in the explicit order of the milestones to achieve project success.
         &nbsp;<br></br><br></br>
         <strong class="body">2. OVERDUE TASKS</strong><br></br><br></br>
         If a task falls overdue, the person responsible  for the task should make every effort to complete the task in a timely manner  or propose a new completion date to the project team members.
         &nbsp;<br></br><br></br>
         <strong class="body">3. PROJECT FAILURE</strong><br></br><br></br>
         If a milestone has not been reached  by its due date due to one or many overdue tasks, the project will fall into  alert status and a priority team meeting will be called to discuss the  milestone and overdue tasks.
         &nbsp;<br></br><br></br>
         The project manager reserves the  right to re-allocate the task to another team member to complete the task or  freeze the project if there is a lack of commitment and/or resources from the  team member.
         &nbsp;<br></br><br></br>
         <strong class="body">4. LOCALE</strong><br></br><br></br>
         Please take note:

         <p><ul>Date Format: dd/mm/yy (please note that long  date format may be used)</ul>
         <ul>Language of Document: English (British)</ul></p>

           <strong class="body">5. TERMINOLOGY</strong><br></br><br></br>

        UAT – User Acceptance  Testing</td>
     </tr>
   </table>
   <br></br>
   </apex:outputPanel> 
<table border="1" cellpadding="5" width="75%" align="center"> 
     <tr>
       <td class="headerbackgroundblue">MILESTONES</td>
     </tr>  
 <apex:dataTable value="{!miiProject__Project__c.miiProject__Project_Milestones__r}" var="m" cellpadding="5" border="1" width="75%" align="center">
       <apex:column headerClass="headerbackgroundgrey" headerValue="Milestone" value="{!m.miiProject__Subject__c}"/> 
       <apex:column headerClass="headerbackgroundgrey" headerValue="Due Date" value="{!m.miiProject__Date_Due__c}"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Completed Date" value="{!m.miiProject__Date_Time_Completed__c}"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Signed Off?"/>
   </apex:dataTable>
</table>
<br></br>
<table border="1" cellpadding="5" width="75%" align="center"> 
     <tr>
       <td class="headerbackgroundblue">TASKS</td>
     </tr>
 <apex:dataTable value="{!miiProject__Project__c.Project_Tasks__r}" var="t" cellpadding="5" border="1" width="75%" align="center">
       <apex:column headerClass="headerbackgroundgrey" headerValue="Milestone" value="{!t.Milestone_Subject__c}"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Task" value="{!t.miiProject__Subject__c}"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Detail" value="{!t.miiProject__Description__c}"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Assigned To" value="{!t.miiProject__Assigned_To__c}"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Due Date" value="{!t.miiProject__Date_Due__c}"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Status" value="{!t.miiProject__Status__c}"/>
 </apex:dataTable>
</table> 
<br></br>
<table border="1" cellpadding="5" width="75%" align="center"> 
     <tr>
       <td class="headerbackgroundblue">RISK/ENHACEMENT ANALYSIS LOG</td>
     </tr>  
   <apex:dataTable value="{!miiProject__Project__c.Project_Risks_Enhancments__r}" var="ri" cellpadding="5" border="1" width="75%" align="center" >            
       <apex:column headerClass="headerbackgroundgrey" headerValue="ID" value="{!ri.Name}"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Nature Of Risk Or Uncertainty" value="{!ri.Subject__c}"/>  
       <apex:column headerClass="headerbackgroundgrey" headerValue="Description Of Requirements" value="{!ri.Description__c}"/>  
       <apex:column headerClass="headerbackgroundgrey" headerValue="Status" value="{!ri.Status__c}"/>
   </apex:dataTable>  
</table> 
<br></br>
<table border="1" cellpadding="5" width="75%" align="center"> 
     <tr>
       <td class="headerbackgroundblue">APPENDICES</td>
     </tr>  
   <apex:dataTable value="{!miiProject__Project__c.Project_Appendixs__r}" var="ap" cellpadding="5" border="1" width="75%" align="center" >            
       <tr>
       <apex:column headerClass="headerbackgroundgrey" headerValue="ID" value="{!ap.Name} - {!ap.Subject__c}"/><br></br>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Description" value="{!ap.Description__c}"/>  
       </tr>
   </apex:dataTable>  
</table>
<br></br>
<table border="1" cellpadding="5" width="75%" align="center"> 
     <tr>
       <td class="headerbackgroundorange">SETUP COSTS</td>
     </tr>  
   <apex:dataTable value="{!SetupCostsList}" var="cose" cellpadding="5" border="1" width="75%" align="center" >            
       <tr>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Description" value="{!cose.Description__c}"/>  
       <apex:column headerClass="headerbackgroundgrey" headerValue="Cost Per Hour" value="{!cose.Amount_Per_Hour__c}"/>  
       <apex:column headerClass="headerbackgroundgrey" headerValue="Hour(s)" value="{!cose.Hours__c}"/> 
       <apex:column headerClass="headerbackgroundgrey" headerValue="Setup Cost" value="{!cose.Cost_Total__c}"/>   
       </tr>
   </apex:dataTable>  
</table> 
<br></br>
<table border="1" cellpadding="5" width="75%" align="center"> 
     <tr>
       <td class="headerbackgroundorange">ONGOING COSTS</td>
     </tr>  
   <apex:dataTable value="{!OngoingCostsList}" var="coon" cellpadding="5" border="1" width="75%" rows="5" align="center">           
       <tr>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Product" value="{!coon.Product_Name__c}"/><br></br>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Description" value="{!coon.Description__c}"/>  
       <apex:column headerClass="headerbackgroundgrey" headerValue="# Users" value="{!coon.Number_Of_Users__c}"/>  
       <apex:column headerClass="headerbackgroundgrey" headerValue="$ Per User" value="{!coon.Amount_Per_User__c}"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Total/Month" value="{!coon.Cost_Total__c}"/>  
       </tr>
   </apex:dataTable>  
</table>   
</html> 
</apex:page>

 

Here are my 2 classes

 

public with sharing class OngoingCostsList {
    public OngoingCostsList(ApexPages.StandardController controller) {
    }
    List<Project_Cost__c> myList;
    Public List<Project_Cost__c> getOngoingCostsList() {
        myList = [
        SELECT Id, Name, Type__c, Product_For_Sale__c, Amount_Per_Hour__c, Hours__c, Cost_Total__c, URL__c, Amount_Per_User__c, Description__c, Number_Of_Users__c, Product_Name__c, Cost_Total_Dollars__c FROM Project_Cost__c 
        WHERE Type__c = 'On Going' 
        ORDER BY Name DESC 
        ];
    /// ORDER BY CAN BE ASC OR DESC    
    return  myList;
    }     
}

 

 

public class SetupCostsList {
    public SetupCostsList(ApexPages.StandardController controller) {
    }
    List<Project_Cost__c> myList;
    Public List<Project_Cost__c> getSetupCostsList() {
        myList = [SELECT Id, Name, Type__c, Product_For_Sale__c, Amount_Per_Hour__c, Hours__c, Cost_Total__c, URL__c, Amount_Per_User__c, Description__c, Number_Of_Users__c, Product_Name__c, Cost_Total_Dollars__c FROM Project_Cost__c WHERE Type__c = 'Setup' ORDER BY Name DESC ];
    /// ORDER BY CAN BE ASC OR DESC  
    return  myList;
    }      
}

 

Thank you in advance


David

 

 

Hello

 

I have a class which is looking up object records to display in a picklist. My issue is that by default, the picklist field is displaying a value. I would like to default value to be NULL (user has to select one), and then the values under NULL (- None -) be the records of my class query

 

Thanks in advance

 

VF

 

<apex:page standardController="Invoice__c" extensions="newInvoiceLineItems,CurrencyPL,TaxPL,ProductPL">
    <apex:form >
    <apex:sectionHeader title="Invoice and Credit Memo" subtitle="{!Invoice__c.Name}"  /> 
    <apex:pageBlock title="Invoice and Credit Memo Detail" >
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}" rerender="error" />
                <apex:commandButton value="Cancel" action="{!cancel}" rerender="error" />
            </apex:pageBlockButtons>
            <apex:pageMessages ></apex:pageMessages>
        <apex:pageBlockSection title="Information" columns="2" collapsible="false">
            <apex:inputField value="{!Invoice__c.Customer__c}" required="true" />
            <apex:pageBlockSectionItem >
                <apex:outputLabel value="Currency"/>
                <apex:outputPanel layout="block" styleClass="requiredInput" >
                <apex:outputPanel layout="block" styleClass="requiredBlock"/>
                <apex:selectList value="{!Invoice__c.Currency__c}" 
                     required="True" size="1" id="invoicecurr">
                    <apex:selectOptions value="{!getCurrency}"/>
                </apex:selectList>
                </apex:outputPanel>
            </apex:pageBlockSectionItem> 
            <apex:inputField value="{!Invoice__c.Date_Document__c}" required="true" /> 
            <apex:inputField value="{!Invoice__c.Due_Date__c}" required="true" />
            <apex:inputField value="{!Invoice__c.Type__c}" required="true" />  
            
            <apex:pageBlockSectionItem >
                <apex:outputLabel value="Description"/>
                <apex:outputPanel layout="block" styleClass="requiredInput" >
                <apex:outputPanel layout="block" styleClass="requiredBlock"/>
                <apex:inputTextarea value="{!Invoice__c.Description__c}" required="true" cols="40" rows="3" /> 
                </apex:outputPanel>
            </apex:pageBlockSectionItem> 
            
        </apex:pageBlockSection>   
            <apex:pageBlockTable value="{!lines}" var="li" id="table">  
                <apex:column headerValue="Line Items" colspan="2">
                    <apex:outputLabel value="Description"/>
                    <apex:inputField value="{!li.Display_Name__c}" required="true"/>
                    <apex:outputLabel value="Amount inc Tax"/>
                    <apex:inputField value="{!li.Amount_Inc_Tax__c}" required="true"/>
                    <apex:outputLabel value="Invoice"/>
                    <apex:inputField value="{!li.Invoice__c}"/>
                    
               <apex:outputLabel value="Currency"/>
                        <apex:outputPanel layout="block" styleClass="requiredInput" >
                        <apex:outputPanel layout="block" styleClass="requiredBlock"/>
                            <apex:selectList value="{!li.Currency__c}" required="True" size="1">
                    <apex:selectOptions value="{!getCurrency}"/>
                </apex:selectList>
                </apex:outputPanel>

               <apex:outputLabel value="Product"/>
                        <apex:outputPanel layout="block" styleClass="requiredInput" >
                        <apex:outputPanel layout="block" styleClass="requiredBlock"/>
                            <apex:selectList value="{!li.Product_For_Sale__c}" required="True" size="1">
                    <apex:selectOptions value="{!getProduct}"/>
                </apex:selectList>
                </apex:outputPanel>
                
               <apex:outputLabel value="Tax"/>
                        <apex:outputPanel layout="block" styleClass="requiredInput" >
                        <apex:outputPanel layout="block" styleClass="requiredBlock"/>
                            <apex:selectList value="{!li.Tax__c}" required="True" size="1">
                    <apex:selectOptions value="{!getTax}"/>
                </apex:selectList>
                </apex:outputPanel>                
                    
                    <apex:outputLabel value="Quantity"/>
                    <apex:inputField value="{!li.Quantity__c}" required="true"/>
                                                       
                    <apex:commandLink value="Add Row" action="{!addRow}" rerender="table,error" immediate="true" />&nbsp;|&nbsp;&nbsp;
                    <apex:commandLink value="Remove Row" action="{!removeRow}" rerender="table,error" immediate="true" />
                 </apex:column>    
            </apex:pageBlockTable>   
              
    </apex:pageBlock>
    </apex:form>
</apex:page>

 

class

 

public class ProductPL {
    private miiFinance__Invoice__c invoice;
    public ProductPL(ApexPages.StandardController controller) {
    this.invoice = (miiFinance__Invoice__c)controller.getRecord();
    }
    public List <SelectOption> getProduct {
    Get{
    List <SelectOption> product = new List <SelectOption>();
    for( miiFinance__Product_For_Sale__c pr: [select Name, miiFinance__Display_Name__c from miiFinance__Product_For_Sale__c])
    product.add(new selectOption(pr.id, pr.Name + ' - ' +  pr.miiFinance__Display_Name__c));
    return product;
    }
    Set;
    }
    }

 

 

Hello

 

I am trying to achieve a 2 step wizard for an invoice.

 

Step 1: create the invoice record and click custom "save" button

Step 2: record is saved, and user is redirected to a 2nd step page, carrying with it step 1's id within the URL

 

I cannot for the life of me get the ID of the invoice record (step 1) to carry through to step 2.

 

Is there any step by step, i have looked all over this forum. Thanks in advance

 

Here is my vf

 

<apex:page standardController="Invoice__c" extensions="CurrencyPL">
    <apex:form >
    <apex:pageBlock title="Invoice Details" >
                <apex:pageBlockButtons >
                      <apex:commandButton action="{!saveAndRedirect}" value="Save Invoice & Add Line Items"/>
                      <apex:commandButton action="{!cancel}" value="Cancel" onclick="return confirmCancel()" immediate="true"/>
                </apex:pageBlockButtons>
            <apex:pageMessages ></apex:pageMessages>
        <apex:pageBlockSection title="Information" columns="2" collapsible="false">
            <apex:inputField value="{!Invoice__c.Customer__c}" required="true" />
            <apex:pageBlockSectionItem >
                <apex:outputLabel value="Currency"/>
                <apex:outputPanel layout="block" styleClass="requiredInput" >
                <apex:outputPanel layout="block" styleClass="requiredBlock"/>
                <apex:selectList value="{!Invoice__c.Currency__c}" 
                     required="True" size="1" id="invoicecurr">
                    <apex:selectOptions value="{!getCurrency}"/>
                </apex:selectList>
                </apex:outputPanel>
                </apex:pageBlockSectionItem> 
            <apex:inputField value="{!Invoice__c.Date_Document__c}" required="true" /> 
            <apex:inputField value="{!Invoice__c.Due_Date__c}" required="true" />
            <apex:inputField value="{!Invoice__c.Type__c}" required="true" />  
            <apex:inputTextarea value="{!Invoice__c.Description__c}" required="true" /> 
        </apex:pageBlockSection>   
    </apex:pageBlock>
    </apex:form>
</apex:page>

 

here is my class

 

public class CurrencyPL {
    private miiFinance__Invoice__c invoice;
    public CurrencyPL(ApexPages.StandardController controller) {
    this.invoice = (miiFinance__Invoice__c)controller.getRecord();
    }

   public PageReference step2() {
      return Page.NewInvoicePage2;
   }

public PageReference saveAndRedirect() {
  stdCtrl.save(); // This takes care of the details for you.
  PageReference saveAndRedirectPage = Page.NewInvoicePage2; 

somewhere here place '.id'

  saveAndRedirectPage.setRedirect(true);
  return saveAndRedirectPage;
}

    public List <SelectOption> getCurrency {
    Get{
    List <SelectOption> curr = new List <SelectOption>();
    for( miiFinance__Currency__c cu: [select Name from miiFinance__Currency__c WHERE miiFinance__Active__c = TRUE])
    curr.add(new selectOption(cu.id, cu.Name));
    return curr;
    }
    Set;
    }
    }

 

 

Hello

 

I am displaying a lookup (Name) value in my pikclist value, which is a lookup to another object. I was hoping to display a different field value (not the autonumber .Name value) in the picklist value. Or perhaps a string of multiple values (Name.customfield__c). Is this possible?

 

This code gives the name (autonumber) value, but i would like to display the (miiFinance__Display_Name__c) value, and capture the Id so it saves correctly. Here is my code so far.

 

VF

 

<apex:page StandardController="Invoice__c" extensions="MultiAdd,CurrencyPL,TaxPL,ProductPL" id="thePage">
<apex:form >
<apex:pageblock id="pb" >
    <apex:pageBlockButtons >
        <apex:commandbutton value="Add Line Item" action="{!Add}" rerender="pb1"/>
        <apex:commandbutton value="Save Invoice" action="{!Save}"/>
    </apex:pageBlockButtons>
    
    <apex:pageBlockSection title="Information" columns="2" collapsible="false">
        <apex:inputField value="{!Invoice__c.Customer__c}" required="true" />


        <apex:selectList required="true" id="icurr" value="{!Invoice__c.Currency__c}" size="1">
        <apex:selectOptions value="{!getCurrency}"/>
        </apex:selectList>
        
        <apex:inputField value="{!Invoice__c.Date_Document__c}" required="true" />
        <apex:inputField value="{!Invoice__c.Type__c}" required="true" />
        <apex:inputField value="{!Invoice__c.Due_Date__c}" required="true" />    
    </apex:pageBlockSection>    
        
        
        <apex:pageblock id="pb1">
            
        <apex:repeat value="{!lstInner}" var="e1" id="therepeat">
                <apex:panelGrid columns="8">
                
                <apex:panelGrid headerClass="Name">
                    <apex:facet name="header">Delete</apex:facet>
                    <apex:commandButton value="Remove" action="{!Del}" rerender="pb1">
                        <apex:param name="rowToBeDeleted" value="{!e1.recCount}" assignTo="{!selectedRowIndex}"></apex:param>
                    </apex:commandButton>
                </apex:panelGrid>   
                
                <apex:panelGrid title="SPD" >
                    <apex:facet name="header">Display Name</apex:facet>
                    <apex:inputfield value="{!e1.acct.Display_Name__c}" required="true"/>
                </apex:panelGrid>
                
                <apex:panelGrid >
                    <apex:facet name="header">Product</apex:facet>
                    
                    <apex:selectList id="prod" value="{!e1.acct.Product_For_Sale__c}" size="1" title="Product">
                    <apex:selectOptions value="{!getProduct}"/>
                    </apex:selectList>
                    
                </apex:panelGrid>

                <apex:panelGrid >
                    <apex:facet name="header">Tax</apex:facet>
                    
                    <apex:selectList id="tax" value="{!e1.acct.Tax__c}" size="1" title="Tax">
                    <apex:selectOptions value="{!getTax}"/>
                    </apex:selectList>
                    
                </apex:panelGrid>


                <apex:panelGrid >
                    <apex:facet name="header">Currency</apex:facet>
                    
                    <apex:selectList id="curr" value="{!e1.acct.Currency__c}" size="1" title="Currency">
                    <apex:selectOptions value="{!getCurrency}"/>
                    </apex:selectList>
                    
                </apex:panelGrid>
                
                <apex:panelGrid >
                    <apex:facet name="header">Invoice</apex:facet>
                    <apex:inputfield value="{!e1.acct.Invoice__c}" required="true" />
                </apex:panelGrid>

                <apex:panelGrid >
                    <apex:facet name="header">Amount inc Tax</apex:facet>
                    <apex:inputfield value="{!e1.acct.Amount_Inc_Tax__c}" required="true" />
                </apex:panelGrid>                              
                
            </apex:panelgrid>
        </apex:repeat>
    </apex:pageBlock>
</apex:pageblock>
</apex:form>
</apex:page>

 

Here is the class which is involved. If i get this one, i can replicate the code and make it all work

 

public class ProductPL {
    private miiFinance__Invoice__c invoice;
    public ProductPL(ApexPages.StandardController controller) {
    this.invoice = (miiFinance__Invoice__c)controller.getRecord();
    }
    public List <SelectOption> getProduct {
    Get{
    List <SelectOption> product = new List <SelectOption>();
    for( miiFinance__Product_For_Sale__c pr: [select Name from miiFinance__Product_For_Sale__c])
    product.add(new selectOption(pr.id, pr.Name));
    return product;
    }
    Set;
    }
    }

  I believe the line

 

[select Name from miiFinance__Product_For_Sale__c])

 

is the issue, and when i add the custom field, i get the error 

 

System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: miiFinance__Product_For_Sale__c.Name 

 

I add that field to my query

 

    product.add(new selectOption(pr.id, pr.Name, pr.miiFinance__Display_Name__c));

 i get this error

 

Error: ProductPL Compile Error: Constructor not defined: [System.SelectOption].<Constructor>(Id, String, String) at line 10 column 17

 

Line 10 is the code above

 

Please let me know your thoughts

 

Dave

 


Hello

 

I am trying to achieve having this parent record (miiFinance__Invoice__c) save. My code is not quite finished, however this is my first hurdle. I reused this code when creating multiple account records from the one page, so thats why some reference to acct is in there.

 

My outcome is to have this invoice__c record save and have the related miiFinance__Invoice_Line_Item__c records relate and save also. This code works if i manually look up and already saved invoice. How can i

 

1. pass the future/new ID of ths miiFinance__Invoice__c record into the newly, to be created, miiFinance__Invoice_Line_Item__c records?

2. have the parent miiFinance__Invoice__c record save to the database upon saving the record?

 

Thank you in advance

 

Here is my VF page

 

<apex:page StandardController="Invoice__c" extensions="MultiAdd" id="thePage">
<apex:form >
<apex:pageblock id="pb" >
    <apex:pageBlockButtons >
        <apex:commandbutton value="Add Line Item" action="{!Add}" rerender="pb1"/>
        <apex:commandbutton value="Save Invoice" action="{!Save}"/>
    </apex:pageBlockButtons>
    
    <apex:pageBlockSection title="Information" columns="2" collapsible="false">
        <apex:inputField value="{!Invoice__c.Customer__c}" required="true" />
        <apex:inputField value="{!Invoice__c.Currency__c}" required="true" />
        <apex:inputField value="{!Invoice__c.Date_Document__c}" required="true" />
        <apex:inputField value="{!Invoice__c.Type__c}" required="true" />
        <apex:inputField value="{!Invoice__c.Due_Date__c}" required="true" />    
    </apex:pageBlockSection>    
        
        
        <apex:pageblock id="pb1">
            
        <apex:repeat value="{!lstInner}" var="e1" id="therepeat">
                <apex:panelGrid columns="8">
                
                <apex:panelGrid headerClass="Name">
                    <apex:facet name="header">Delete</apex:facet>
                    <apex:commandButton value="Remove" action="{!Del}" rerender="pb1">
                        <apex:param name="rowToBeDeleted" value="{!e1.recCount}" assignTo="{!selectedRowIndex}"></apex:param>
                    </apex:commandButton>
                </apex:panelGrid>   
                
                <apex:panelGrid title="SPD" >
                    <apex:facet name="header">Display Name</apex:facet>
                    <apex:inputfield value="{!e1.acct.Display_Name__c}" required="true"/>
                </apex:panelGrid>
                
                <apex:panelGrid >
                    <apex:facet name="header">Product</apex:facet>
                    <apex:inputfield value="{!e1.acct.Product_For_Sale__c}" required="true"/>
                </apex:panelGrid>
                
                <apex:panelGrid >
                    <apex:facet name="header">Currency</apex:facet>
                    <apex:inputfield value="{!e1.acct.Currency__c}" required="true"/>
                </apex:panelGrid>
                
                <apex:panelGrid >
                    <apex:facet name="header">Tax Type</apex:facet>
                    <apex:inputfield value="{!e1.acct.Tax__c}" required="true"/>
                </apex:panelGrid>

                <apex:panelGrid >
                    <apex:facet name="header">Quantity</apex:facet>
                    <apex:inputfield value="{!e1.acct.Amount_Inc_Tax__c}" required="true" />
                </apex:panelGrid>
                
                <apex:panelGrid >
                    <apex:facet name="header">Invoice</apex:facet>
                    <apex:inputfield value="{!e1.acct.Invoice__c}" required="true" />
                </apex:panelGrid>

                <apex:panelGrid >
                    <apex:facet name="header">Amount</apex:facet>
                    <apex:inputfield value="{!e1.acct.Amount_Inc_Tax__c}" required="true" />
                </apex:panelGrid>                              
                
            </apex:panelgrid>
        </apex:repeat>
    </apex:pageBlock>
</apex:pageblock>
</apex:form>
</apex:page>

 

Here is my extension

 

public class MultiAdd
{
    
    //will hold the account records to be saved
    public List<miiFinance__Invoice_Line_Item__c>lstAcct  = new List<miiFinance__Invoice_Line_Item__c>();
    
    //list of the inner class
    public List<innerClass> lstInner 
    {   get;set;    }
    
    //will indicate the row to be deleted
    public String selectedRowIndex
    {get;set;}  
    
    //no. of rows added/records in the inner class list
    public Integer count = 1;
    //{get;set;}
    
    
    ////save the records by adding the elements in the inner class list to lstAcct,return to the same page
    public PageReference Save()
    {
        PageReference pr = new PageReference('/apex/MultiAdd');
        
        for(Integer j = 0;j<lstInner.size();j++)
        {
            lstAcct.add(lstInner[j].acct);
        } 
        insert lstAcct;
        pr.setRedirect(True);
        return pr;
    }
        
    //add one more row
    public void Add()
    {   
        count = count+1;
        addMore();      
    }
    
    /*Begin addMore*/
    public void addMore()
    {
        //call to the iner class constructor
        innerClass objInnerClass = new innerClass(count);
        
        //add the record to the inner class list
        lstInner.add(objInnerClass);    
        system.debug('lstInner---->'+lstInner);            
    }/* end addMore*/
    
    /* begin delete */
    public void Del()
    {
        system.debug('selected row index---->'+selectedRowIndex);
        lstInner.remove(Integer.valueOf(selectedRowIndex)-1);
        count = count - 1;
        
    }/*End del*/
    
    
    
    /*Constructor*/
    public MultiAdd(ApexPages.StandardController ctlr)
    {
    
        lstInner = new List<innerClass>();
        addMore();
        selectedRowIndex = '0';
        
    }/*End Constructor*/
        


    /*Inner Class*/
    public class innerClass
    {       
        /*recCount acts as a index for a row. This will be helpful to identify the row to be deleted */
        public String recCount
        {get;set;}
        
        
        public miiFinance__Invoice_Line_Item__c acct 
        {get;set;}
        
        /*Inner Class Constructor*/
        public innerClass(Integer intCount)
        {
            recCount = String.valueOf(intCount);        
            
            /*create a new account*/
            acct = new miiFinance__Invoice_Line_Item__c();
            
        }/*End Inner class Constructor*/    
    }/*End inner Class*/
}/*End Class*/

 


Our Force.com for Amazon Web Services no longer has its associated APEX Classes marked as Active

When we try connect to the object in SF, we get these errors

Apex class 'AWS_S3_ExampleController' does not exist

I have checked the classes and they are all marked "Inactive"

How can I make these classes "Active". I did not deactivate them.

I can login to the AWS via their AWS website.

I raised a case with Salesforce and they no longer support "development" questions under my enterprise support agreement.

 

Has anyone had this happen, know how to make them active again, or an idea how i can restore it (reinstall?)

 

Regards

David

Hello

 

Can someone please tell me where i am going wrong with this code? The saveURL is simly not being executed, and the record stays on the newly created record after save. If you cancel, yes, it does revert back to the parent, but the save ALWAYS stays on the child, where i would like it to go back to the parent (ticket is the parent, ticket comment is the child)

 

/apex/AddComment?CF00N90000002Fdf1={!miiHelpDeskT2__Ticket__c.Name}&CF00N90000002Fdf1_lkid={!miiHelpDeskT2__Ticket__c.Id}&CF00N90000002Fdf8{!miiHelpDeskT2__Ticket__c.miiHelpDeskT2__Ticket_Manager_Name__c}&CF00N90000002Fdf8_lkid={!miiHelpDeskT2__Ticket__c.miiHelpDeskT2__Ticket_Manager_NameId__c}&CF00N90000002zw4A_lkid={!miiHelpDeskT2__Ticket__c.miiHelpDeskT2__Subject__c}&CF00N90000002zw4F_lkid={!miiHelpDeskT2__Ticket__c.miiHelpDeskT2__Description__c}&sfdc.override=1&retURL=%2F{!miiHelpDeskT2__Ticket__c.Id}&saveURL=%2F{!miiHelpDeskT2__Ticket__c.Id}

 

Its worth mentioning that without the below part, the whole custom button does not work

 

&sfdc.override=1

Hello. I am making a 'feed' type visualforce page for my home dashboard, and i am displaying the most recent 5 records. Within those records, there is a richtext type field, which is the "Comment". I am trying to only display the first 5 rows of the field data (not the whole field as the info can get to long and stretch the page). Is there a way to limit the number of rows/characters which display on a richtext field type. I know i can do it on a standard text field, but not a richtext? The field is

 

value="{!t.miiHelpDeskT2__Comment__c}" 

 

Thanks in advance

 

Here is my VF

 

<apex:page standardController="miiHelpDeskT2__Ticket__c" showheader="false" sidebar="false" extensions="TicketCommentFeedList">
<html>
<style type="text/css">
a:link    {
  /* Applies to all unvisited links */
  text-decoration:  none;
  font-weight:      bold;
  color:            blue;
  } 
a:visited {
  /* Applies to all visited links */
  text-decoration:  none;
  font-weight:      bold;
  color:            #f0f;
  } 
a:hover   {
  /* Applies to links under the pointer */
  text-decoration:  underline;
  font-weight:      bold;
  color:            #fff;
  } 
a:active  {
  /* Applies to activated links */
  text-decoration:  underline;
  font-weight:      bold;
  color: white;
  } 
.ticket {font-family:arial,Georgia,Serif; font-size: 12px; font-weight:bold; color:#6699CC}
</style>
  <apex:repeat value="{!TicketCommentFeedList}" var="t" rows="5">
      <table width="100%" border="1" cellpadding="5">
      <tr>
        <td>
        <a href="https://ap1.salesforce.com/{!t.miiHelpDeskT2__Ticket__c}" target="_parent">
        <apex:outputText styleClass="ticket" value="{!t.miiHelpDeskT2__Ticket_Number__c}"/>
        </a>&nbsp;:&nbsp;
        <apex:outputText style="font-size:11px;" value="{!t.miiHelpDeskT2__Subject__c}"/>&nbsp;:&nbsp;
        <apex:outputText style="font-size:11px;" value="{!t.Contact_Who_Made_Comment_Name__c}" escape="false"/>&nbsp;@&nbsp;<apex:outputText style="font-size:11px;" value=" {!t.miiHelpDeskT2__Created_Date_Time__c}"></apex:outputText><br></br><br></br><apex:outputText style="font-size:11px;" value="{!t.miiHelpDeskT2__Comment__c}" escape="false"/>
        
        </td>
      </tr>
      </table> 
  </apex:repeat> 
</html>   
</apex:page>

 

Here is my class

 

public class TicketCommentFeedList {

    private ApexPages.StandardController stdCtrl;
    
    public TicketCommentFeedList(ApexPages.StandardController controller)

    {

        stdCtrl=controller;

    }

    List<miiHelpDeskT2__Ticket_Comment__c> myList;

    Public List<miiHelpDeskT2__Ticket_Comment__c> getTicketCommentFeedList() {

myList = [SELECT Id, Name, miiHelpDeskT2__Ticket__c, miiHelpDeskT2__Active__c, miiHelpDeskT2__Comment__c, miiHelpDeskT2__Contact_Name__c, miiHelpDeskT2__Contact_Who_Made_Comment_Email__c, miiHelpDeskT2__Contact_Who_Made_Comment__c, miiHelpDeskT2__Created_Date_Time__c, miiHelpDeskT2__Is_Member_Comment__c, miiHelpDeskT2__Is_Ticket_Answered__c, miiHelpDeskT2__Public__c, miiHelpDeskT2__Send_Customer_Notification__c, miiHelpDeskT2__Subject__c, miiHelpDeskT2__Ticket_Manager_Email__c, miiHelpDeskT2__Ticket_Manager_Name__c, miiHelpDeskT2__Ticket_Number__c, miiHelpDeskT2__ID_Historic__c, Ticket_Comment_Name_Historic__c, Ticket_Subject__c, Ticket_Description__c, Contact_First_Name__c, Contact_Who_Made_Comment_Name__c FROM miiHelpDeskT2__Ticket_Comment__c WHERE miiHelpDeskT2__Active__c = True ORDER BY miiHelpDeskT2__Created_Date_Time__c DESC ];

    /// ORDER BY CAN BE ASC OR DESC 

    return  myList;

    }

    public static testmethod void Test1()

    {

    Project_Cost__c p=new Project_Cost__c();

    ApexPages.StandardController sc = new ApexPages.standardController(p);

           

    TicketCommentFeedList Tcfl=new TicketCommentFeedList (sc);

    Tcfl.getTicketCommentFeedList();

    }     

}

 

Hello Community

 

I am trying to use a class to draw records from a child of the parent, but im returning ALL the records for the object, just not those related to that recordID. My extensions should only return records that are related to the parentID. I believe it has something to do with my WHERE statement and getID but im very new. Thanks in advance

 

Here is my VF Page

 

<apex:page showHeader="false" standardController="miiProject__Project__c" extensions="OngoingCostsList,SetupCostsList,TaskList,MilestoneList">
<html>
<head>
  <style> 
     body {font-family: Arial Unicode MS;}
     .companyName {font-weight:bold;font-size:22px;color:red} 
     .projectplan {font-family: Arial, Helvetica, sans-serif;font-size: 22px;} 
     .projectdetails {font-family: Arial, Helvetica, sans-serif;font-size: 12px;} 
     .body {font-family: Arial, Helvetica, sans-serif;font-size: 10px; vertical-align:top; text-align:top; } 
     .total {font-family: Arial, Helvetica, sans-serif;font-size: 10px; vertical-align:middle; text-align:middle; } 
     .headerbackgroundblue {font-family: Arial, Helvetica, sans-serif;font-size: 12px;background-color:#003399;color: #FFFFFF;font-weight:bold;}
     .headerbackgroundgrey {font-family: Arial, Helvetica, sans-serif;font-size: 11px;background-color:#EFEFEF;color: #000000;font-weight:bold;}
     .headerbackgroundorange {font-family: Arial, Helvetica, sans-serif;font-size: 12px;background-color:#FFC993;color: #000000;font-weight:bold;}
     .headerbackgroundgreen {font-family: Arial, Helvetica, sans-serif;font-size: 12px;background-color:#DFFFE1;color: #000000;font-weight:bold;}
     .bordersolid {border:black solid 1px; font-family: Arial, Helvetica, sans-serif;font-size: 10px; vertical-align:middle; text-align:middle;  } 

@page {
    @bottom-center { content:"Page " counter(page) " - Commercial in Confidence - miiForce Pty Ltd | www.miiworks.com";
    margin-left: 3cm;
    margin-right: 3cm;
    font-family: Arial, Helvetica, sans-serif;font-size: 10px;
  }
      }
  </style>
</head>
<table width="100%" border="0" cellpadding="5">
  <tr>
    <td><div align="center">
    <apex:image value="{!$Resource.miiworks177120}" width="177" height="120"/></div></td>
  </tr>
  <tr>
    <td><div align="center" class="projectplan">Project Plan</div></td>
  </tr>
</table>
<br></br>
<table width="40%" border="0" align="center" cellpadding="5">
  <tr>
    <td class="body">Company:</td>
    <td class="body"><strong><apex:outputField value=" {!miiProject__Project__c.Account_Name_Text__c}"/></strong></td>
  </tr>
  <tr>
    <td class="body">Document Owner:</td>
    <td class="body"><strong>miiWorks Pty Ltd</strong></td>
  </tr>
  <tr>
    <td class="body">Start Date:</td>
    <td class="body"><strong><apex:outputField value="{!miiProject__Project__c.miiProject__Date_Project_Start__c}"/></strong></td>
  </tr>
  <tr>
    <td class="body">End Date:</td>
    <td class="body"><strong><apex:outputField value="{!miiProject__Project__c.miiProject__Date_Project_End__c}"/></strong></td>
  </tr>
  <tr>
    <td class="body">Version:</td>
    <td class="body"><strong><apex:outputField value="{!miiProject__Project__c.Version__c}"/></strong></td>
  </tr>  
</table>
<br></br>
<table width="40%" border="0" align="center" cellpadding="5">
  <tr>
    <td class="body">Summary:</td>
    <td class="body"><strong><apex:outputField value="{!miiProject__Project__c.miiProject__Subject__c}"/></strong></td>
  </tr>
  <tr>
    <td class="body">Description:</td>
    <td class="body"><apex:outputField value="{!miiProject__Project__c.miiProject__Description__c}"/></td>
  </tr>
</table>

<br></br><br></br>
    
   <apex:outputPanel >
<table border="1" cellpadding="5" width="75%" align="center" valign="top"> 
     <tr>
       <td class="headerbackgroundblue">AREA MANAGERS / RESPONSIBILITIES</td>
     </tr>  
    <apex:dataTable value="{!miiProject__Project__c.Project_Contacts__r}" var="c" cellpadding="5" border="1" width="75%" rows="4" align="center">
       <apex:column headerClass="headerbackgroundgrey" headerValue="Name" value="{!c.Contact_Text__c}" width="100px" styleClass="body" />
       <apex:column headerClass="headerbackgroundgrey" headerValue="Company" value="{!c.Account_Name__c}" styleClass="body"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Role" value="{!c.Role__c}" styleClass="body"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Responsibilities" value="{!c.Responsibilities__c}" styleClass="body" />
    </apex:dataTable>
</table> 
&nbsp;
   <table border="1" cellpadding="5" width="75%" align="center">
     <tr>
       <td class="headerbackgroundblue">GUIDELINES</td>
     </tr>
     <tr>
       <td styleClass="body"><br></br>
         <strong class="body">1. EXECUTION OF  MILESTONES</strong><br></br>
         <span class="body">The project execution must be  completed in the explicit order of the milestones to achieve project success.</span>
         &nbsp;<br></br><br></br>
         <strong class="body">2. OVERDUE TASKS</strong><br></br>
         <span class="body">If a task falls overdue, the person responsible  for the task should make every effort to complete the task in a timely manner  or propose a new completion date to the project team members.</span>
         &nbsp;<br></br><br></br>
         <strong class="body">3. PROJECT FAILURE</strong><br></br>
         <span class="body">If a milestone has not been reached  by its due date due to one or many overdue tasks, the project will fall into  alert status and a priority team meeting will be called to discuss the  milestone and overdue tasks.</span>
         &nbsp;<br></br>
         <span class="body">
         The project manager reserves the  right to re-allocate the task to another team member to complete the task or  freeze the project if there is a lack of commitment and/or resources from the  team member.</span>
         &nbsp;<br></br><br></br>
         <strong class="body">4. LOCALE</strong><br></br>
         <span class="body">Please take note:</span>
         <p><ul>
           <span class="body">Date Format: dd/mm/yy (please note that long  date format may be used)</span>
         </ul>
         <ul>
           <span class="body">Language of Document: English (British)</span>
         </ul></p>
           <strong class="body">5. TERMINOLOGY</strong><br></br>
           <span class="body">UAT – User Acceptance  Testing</span></td>
     </tr>
   </table>
   <br></br>
   </apex:outputPanel> 
<table border="1" cellpadding="5" width="75%" align="center"> 
     <tr>
       <td class="headerbackgroundblue">MILESTONES</td>
     </tr>  
 <apex:dataTable value="{!MilestoneList}" var="m" cellpadding="5" border="1" width="75%" align="center">
       <apex:column headerClass="headerbackgroundgrey" headerValue="Milestone" value="{!m.miiProject__Subject__c}" styleClass="body"/> 
       <apex:column headerClass="headerbackgroundgrey" width="65px" headerValue="Due Date" value="{!m.miiProject__Date_Due__c}" styleClass="body"/>
       <apex:column headerClass="headerbackgroundgrey" width="90px" headerValue="Signed Off Date" value="{!m.Date_Signed_Off__c}" styleClass="body"/>
       <apex:column headerClass="headerbackgroundgrey" width="90px" headerValue="Completed Date" value="{!m.miiProject__Date_Time_Completed__c}" styleClass="body"/>
       <apex:column headerClass="headerbackgroundgrey" width="65px" headerValue="Signed Off?" styleClass="body" >
       <apex:outputText value="{!m.Signed_Off__c}" escape="false"/>
       </apex:column>
   </apex:dataTable>
</table>
<br></br>
<table border="1" cellpadding="5" width="75%" align="center"> 
     <tr>
       <td class="headerbackgroundblue">TASKS</td>
     </tr>
 <apex:dataTable value="{!TaskList}" var="t" cellpadding="5" border="1" width="75%" align="center">
       <apex:column headerClass="headerbackgroundgrey" headerValue="Milestone" value="{!t.Milestone_Subject__c}" styleClass="body"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Task" value="{!t.miiProject__Subject__c}" styleClass="body"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Detail">
           <apex:outputText value="{!t.miiProject__Description__c}" style="body" styleClass="body" escape="false"/>
       </apex:column>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Who" value="{!t.Assigned_To_Text__c}" styleClass="body"/>
       <apex:column headerClass="headerbackgroundgrey" width="65px" headerValue="Due Date" value="{!t.miiProject__Date_Due__c}" styleClass="body"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Status" styleClass="body">
       <apex:outputText value="{!t.Status_Image__c}" escape="false"/>
       </apex:column>
 </apex:dataTable>
</table> 
<br></br>
<table border="1" cellpadding="5" width="75%" align="center"> 
     <tr>
       <td class="headerbackgroundblue">RISK/ENHACEMENT ANALYSIS LOG</td>
     </tr>  
   <apex:dataTable value="{!miiProject__Project__c.Project_Risks_Enhancments__r}" var="ri" cellpadding="5" border="1" width="75%" align="center" >            
       <apex:column headerClass="headerbackgroundgrey" headerValue="ID" value="{!ri.Name}" styleClass="body"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Nature" value="{!ri.Subject__c}" styleClass="body"/>  
       <apex:column headerClass="headerbackgroundgrey" headerValue="Description Of Requirements" value="{!ri.Description__c}" styleClass="body"/>  
       <apex:column headerClass="headerbackgroundgrey" headerValue="Status" value="{!ri.Status__c}" styleClass="body"/>
   </apex:dataTable>  
</table> 
<br></br>
<table border="1" cellpadding="5" width="75%" align="center"> 
     <tr>
       <td class="headerbackgroundblue">APPENDICES</td>
     </tr>  
   <apex:dataTable value="{!miiProject__Project__c.Project_Appendixs__r}" var="ap" cellpadding="5" border="1" width="75%" align="center" >            
       <tr>
       <apex:column headerClass="headerbackgroundgrey" headerValue="ID" value="{!ap.Name} - {!ap.Subject__c}" styleClass="body"/><br></br>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Description" value="{!ap.Description__c}" styleClass="body"/>  
       </tr>
   </apex:dataTable>  
</table>
<br></br>
<table border="1" cellpadding="5" width="75%" align="center"> 
     <tr>
       <td class="headerbackgroundorange">SETUP COSTS</td>
     </tr>  
   <apex:dataTable value="{!SetupCostsList}" var="cose" cellpadding="5" border="1" width="75%" align="center" >            
       <tr>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Description" value="{!cose.Description__c}" styleClass="body"/>  
       <apex:column width="90" headerClass="headerbackgroundgrey" headerValue="Cost Per Hour" value="{!cose.Amount_Per_Hour__c}" styleClass="body"/>  
       <apex:column width="90" headerClass="headerbackgroundgrey" headerValue="Hour(s)" value="{!cose.Hours__c}" styleClass="body"/> 
       <apex:column width="90" headerClass="headerbackgroundgrey" headerValue="Setup Cost" value="{!cose.Cost_Total__c}" styleClass="body"/>   
       </tr> 
   </apex:dataTable> 
   <table cellpadding="5" width="75%" align="center">
       <td valign="top" styleClass="body"><img src="https://ap1.salesforce.com/resource/1330407794000/exclamation"></img><strong class="body">All Prices Exclude GST</strong></td>
       <td width="90" align="left"><strong class="total">Totals:</strong></td>
       <td width="90" align="left" class="bordersolid"><strong><apex:outputField value="{!miiProject__Project__c.Hours_Setup_Total__c}" styleClass="total"/></strong></td>
       <td width="90" align="left" class="bordersolid"><strong><apex:outputField value="{!miiProject__Project__c.Total_Costs_Setup__c}" styleClass="total"/></strong></td>
   </table>
</table> 
<br></br>
<table border="1" cellpadding="5" width="75%" align="center"> 
     <tr>
       <td class="headerbackgroundorange">ONGOING COSTS</td>
     </tr>  
   <apex:dataTable value="{!OngoingCostsList}" var="coon" cellpadding="5" border="1" width="75%" align="center">           
       <tr>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Product" value="{!coon.Product_Name__c}" styleClass="body"/><br></br>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Description" value="{!coon.Description__c}" styleClass="body"/>
       <apex:column width="90" headerClass="headerbackgroundgrey" headerValue="# Users" value="{!coon.Number_Of_Users__c}" styleClass="body"/>  
       <apex:column width="90" headerClass="headerbackgroundgrey" headerValue="$ Per User" value="{!coon.Amount_Per_User__c}" styleClass="body"/>
       <apex:column width="90" headerClass="headerbackgroundgrey" headerValue="Total/Month" value="{!coon.Cost_Total__c}" styleClass="body"/>  
       </tr>
   </apex:dataTable>
   <table cellpadding="5" border="0" width="75%" align="center">
       <td valign="top" styleClass="body"><img src="https://ap1.salesforce.com/resource/1330407794000/exclamation"></img><strong class="body">All Prices Exclude GST</strong></td>
       <td width="90" align="left" styleClass="body"></td>
       <td width="90" align="left" styleClass="body"><strong class="total">Totals:</strong></td>
       <td width="90" align="left" class="bordersolid"><strong><apex:outputField value="{!miiProject__Project__c.Total_Costs_Ongoing__c}" styleClass="total"/></strong></td>
   </table> 
<br></br>
<table border="1" cellpadding="5" width="75%" align="center"> 
     <tr>
       <td class="headerbackgroundgreen"><img src="https://ap1.salesforce.com/resource/1330407553000/greentick"></img>ACCEPTANCE</td>
     </tr>    
     <tr>
       <td><br></br>
         <strong class="body">Project Plan Acceptance: I agree that the information above is a complete and accurate</strong><br></br><br></br>
         <span class="body">The project execution must be  completed in the explicit order of the milestones to achieve project success.</span><br>
         </br><br></br><br></br>
         <br></br>
         <strong class="body">Client Signature: ________________________________________</strong><br></br><br></br>
         <br></br><br></br>
         <strong class="body">Client Full Name: ________________________________________</strong><br></br><br></br>
         <br></br>
         <strong class="body">Client Company Name: <strong><apex:outputField value=" {!miiProject__Project__c.Account_Name_Text__c}"/></strong></strong><br></br><br></br>
         <br></br>
         <strong class="body">Date: ________________________________________</strong><br></br><br></br>       </td>  
     </tr>
   </table>  
</table>   
</html> 
</apex:page>

 

Here is 1 of my classes (I can make changes when i understand methadology)

 

public class TaskList {

    public TaskList(ApexPages.StandardController controller)

    {

    }

    List<miiProject__Project_Task__c> myList;

    Public List<miiProject__Project_Task__c> getTaskList() {

myList = [SELECT Id, IsDeleted, Name, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, miiProject__Project_Milestone__c, miiProject__Account_Name_ID__c, miiProject__Account_Name__c, miiProject__Active__c, miiProject__Actual_Hours__c, miiProject__Alert_Assigned_To__c, miiProject__Assigned_To_Client__c, miiProject__Assigned_To_Email__c, miiProject__Assigned_To__c, miiProject__Contact_Email__c, miiProject__Contact_Name__c, miiProject__Date_Due__c, miiProject__Date_Time_Completed__c, miiProject__Date_Time_Started__c, miiProject__Description__c, miiProject__Internal_Comments__c, miiProject__Is_Closed__c, miiProject__Project_Manager_Email__c, miiProject__Project_Manager_Name__c, miiProject__Public__c, miiProject__Status__c, miiProject__Subject__c, ID_Historic__c, Date_Created_Historic__c, Project__c, Milestone_Subject__c, Status_Image__c, Assigned_To_Text__c FROM miiProject__Project_Task__c ORDER BY miiProject__Date_Due__c ASC ];

    /// ORDER BY CAN BE ASC OR DESC 

    return  myList;

    }

    public static testmethod void Test1()

    {

    miiProject__Project_Task__c p=new miiProject__Project_Task__c();

    ApexPages.StandardController sc = new ApexPages.standardController(p);

           

    TaskList Tas=new TaskList (sc);

    Tas.getTaskList();

    }     

}

 

 

 

 

Hello

 

I am new to Apex and just starting to learn it, so I would appreciate any help here.

 

I was informed the class needs to pass 75% before i can depoly it to my production org

 

Can anyone help me write a Test Class for this? The page is simply querying some related records with a IF filter criteria

 

Here is my page

 

<apex:page showHeader="false" standardController="miiProject__Project__c" extensions="OngoingCostsList,SetupCostsList">
<html>
<head>
  <style> 
     body {font-family: Arial Unicode MS;}
     .companyName {font-weight:bold;font-size:30px;color:red} 
     .projectplan {font-family: Arial, Helvetica, sans-serif;font-size: 36px;} 
     .projectdetails {font-family: Arial, Helvetica, sans-serif;font-size: 18px;} 
     .body {font-family: Arial, Helvetica, sans-serif;font-size: 14px; vertical-align:top; text-align:top; } 
     .headerbackgroundblue {font-family: Arial, Helvetica, sans-serif;font-size: 22px;background-color:#003399;color: #FFFFFF;font-weight:bold;}
     .headerbackgroundgrey {font-family: Arial, Helvetica, sans-serif;font-size: 14px;background-color:#EFEFEF;color: #000000;font-weight:bold;}
     .headerbackgroundorange {font-family: Arial, Helvetica, sans-serif;font-size: 22px;background-color:#FFC993;color: #000000;font-weight:bold;}
  </style>
</head>
<table width="100%" border="0" cellpadding="5">
  <tr>
    <td><div align="center"><img src="http://www.miiworks.com/images/miiworks-177x120.png" width="177" height="120"></img></div></td>
  </tr>
  <tr>
    <td><div align="center" class="projectplan">Project Plan</div></td>
  </tr>
</table>
<br></br>
<table width="20%" border="0" align="center" cellpadding="5">
  <tr>
    <td class="body">Company:</td>
    <td class="body"><strong><apex:outputField value=" {!miiProject__Project__c.miiProject__Account_Name__c}"/></strong></td>
  </tr>
  <tr>
    <td class="body">Document Owner:</td>
    <td class="body"><strong>miiWorks Pty Ltd</strong></td>
  </tr>
  <tr>
    <td class="body">Start Date:</td>
    <td class="body"><strong><apex:outputField value="{!miiProject__Project__c.miiProject__Date_Project_Start__c}"/></strong></td>
  </tr>
  <tr>
    <td class="body">End Date:</td>
    <td class="body"><strong><apex:outputField value="{!miiProject__Project__c.miiProject__Date_Project_End__c}"/></strong></td>
  </tr>
</table>
<br></br>
<table width="20%" border="0" align="center" cellpadding="5">
  <tr>
    <td class="body">Summary:</td>
    <td class="body"><strong><apex:outputField value="{!miiProject__Project__c.miiProject__Subject__c}"/></strong></td>
  </tr>
  <tr>
    <td class="body">Description:</td>
    <td class="body"><apex:outputField value="{!miiProject__Project__c.miiProject__Description__c}"/></td>
  </tr>
</table>

<br></br><br></br>
    
   <apex:outputPanel >
<table border="1" cellpadding="5" width="75%" align="center" valign="top"> 
     <tr>
       <td class="headerbackgroundblue">AREA MANAGERS / RESPONSIBILITIES</td>
     </tr>  
    <apex:dataTable value="{!miiProject__Project__c.Project_Contacts__r}" var="c" cellpadding="5" border="1" width="75%" rows="4" align="center">
       <apex:column headerClass="headerbackgroundgrey" headerValue="Name" value="{!c.Contact__c}" width="100px"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Company" value="{!c.Account_Name__c}"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Role" value="{!c.Role__c}"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Responsibilities" value="{!c.Responsibilities__c}"/>
    </apex:dataTable>
</table> 
&nbsp;

   <table border="1" cellpadding="5" width="75%" align="center">
     <tr>
       <td class="headerbackgroundblue">GUIDELINES</td>
     </tr>
     <tr>
       <td><br></br>
         <strong class="body">1. EXECUTION OF  MILESTONES</strong><br></br><br></br>
         The project execution must be  completed in the explicit order of the milestones to achieve project success.
         &nbsp;<br></br><br></br>
         <strong class="body">2. OVERDUE TASKS</strong><br></br><br></br>
         If a task falls overdue, the person responsible  for the task should make every effort to complete the task in a timely manner  or propose a new completion date to the project team members.
         &nbsp;<br></br><br></br>
         <strong class="body">3. PROJECT FAILURE</strong><br></br><br></br>
         If a milestone has not been reached  by its due date due to one or many overdue tasks, the project will fall into  alert status and a priority team meeting will be called to discuss the  milestone and overdue tasks.
         &nbsp;<br></br><br></br>
         The project manager reserves the  right to re-allocate the task to another team member to complete the task or  freeze the project if there is a lack of commitment and/or resources from the  team member.
         &nbsp;<br></br><br></br>
         <strong class="body">4. LOCALE</strong><br></br><br></br>
         Please take note:

         <p><ul>Date Format: dd/mm/yy (please note that long  date format may be used)</ul>
         <ul>Language of Document: English (British)</ul></p>

           <strong class="body">5. TERMINOLOGY</strong><br></br><br></br>

        UAT – User Acceptance  Testing</td>
     </tr>
   </table>
   <br></br>
   </apex:outputPanel> 
<table border="1" cellpadding="5" width="75%" align="center"> 
     <tr>
       <td class="headerbackgroundblue">MILESTONES</td>
     </tr>  
 <apex:dataTable value="{!miiProject__Project__c.miiProject__Project_Milestones__r}" var="m" cellpadding="5" border="1" width="75%" align="center">
       <apex:column headerClass="headerbackgroundgrey" headerValue="Milestone" value="{!m.miiProject__Subject__c}"/> 
       <apex:column headerClass="headerbackgroundgrey" headerValue="Due Date" value="{!m.miiProject__Date_Due__c}"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Completed Date" value="{!m.miiProject__Date_Time_Completed__c}"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Signed Off?"/>
   </apex:dataTable>
</table>
<br></br>
<table border="1" cellpadding="5" width="75%" align="center"> 
     <tr>
       <td class="headerbackgroundblue">TASKS</td>
     </tr>
 <apex:dataTable value="{!miiProject__Project__c.Project_Tasks__r}" var="t" cellpadding="5" border="1" width="75%" align="center">
       <apex:column headerClass="headerbackgroundgrey" headerValue="Milestone" value="{!t.Milestone_Subject__c}"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Task" value="{!t.miiProject__Subject__c}"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Detail" value="{!t.miiProject__Description__c}"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Assigned To" value="{!t.miiProject__Assigned_To__c}"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Due Date" value="{!t.miiProject__Date_Due__c}"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Status" value="{!t.miiProject__Status__c}"/>
 </apex:dataTable>
</table> 
<br></br>
<table border="1" cellpadding="5" width="75%" align="center"> 
     <tr>
       <td class="headerbackgroundblue">RISK/ENHACEMENT ANALYSIS LOG</td>
     </tr>  
   <apex:dataTable value="{!miiProject__Project__c.Project_Risks_Enhancments__r}" var="ri" cellpadding="5" border="1" width="75%" align="center" >            
       <apex:column headerClass="headerbackgroundgrey" headerValue="ID" value="{!ri.Name}"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Nature Of Risk Or Uncertainty" value="{!ri.Subject__c}"/>  
       <apex:column headerClass="headerbackgroundgrey" headerValue="Description Of Requirements" value="{!ri.Description__c}"/>  
       <apex:column headerClass="headerbackgroundgrey" headerValue="Status" value="{!ri.Status__c}"/>
   </apex:dataTable>  
</table> 
<br></br>
<table border="1" cellpadding="5" width="75%" align="center"> 
     <tr>
       <td class="headerbackgroundblue">APPENDICES</td>
     </tr>  
   <apex:dataTable value="{!miiProject__Project__c.Project_Appendixs__r}" var="ap" cellpadding="5" border="1" width="75%" align="center" >            
       <tr>
       <apex:column headerClass="headerbackgroundgrey" headerValue="ID" value="{!ap.Name} - {!ap.Subject__c}"/><br></br>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Description" value="{!ap.Description__c}"/>  
       </tr>
   </apex:dataTable>  
</table>
<br></br>
<table border="1" cellpadding="5" width="75%" align="center"> 
     <tr>
       <td class="headerbackgroundorange">SETUP COSTS</td>
     </tr>  
   <apex:dataTable value="{!SetupCostsList}" var="cose" cellpadding="5" border="1" width="75%" align="center" >            
       <tr>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Description" value="{!cose.Description__c}"/>  
       <apex:column headerClass="headerbackgroundgrey" headerValue="Cost Per Hour" value="{!cose.Amount_Per_Hour__c}"/>  
       <apex:column headerClass="headerbackgroundgrey" headerValue="Hour(s)" value="{!cose.Hours__c}"/> 
       <apex:column headerClass="headerbackgroundgrey" headerValue="Setup Cost" value="{!cose.Cost_Total__c}"/>   
       </tr>
   </apex:dataTable>  
</table> 
<br></br>
<table border="1" cellpadding="5" width="75%" align="center"> 
     <tr>
       <td class="headerbackgroundorange">ONGOING COSTS</td>
     </tr>  
   <apex:dataTable value="{!OngoingCostsList}" var="coon" cellpadding="5" border="1" width="75%" rows="5" align="center">           
       <tr>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Product" value="{!coon.Product_Name__c}"/><br></br>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Description" value="{!coon.Description__c}"/>  
       <apex:column headerClass="headerbackgroundgrey" headerValue="# Users" value="{!coon.Number_Of_Users__c}"/>  
       <apex:column headerClass="headerbackgroundgrey" headerValue="$ Per User" value="{!coon.Amount_Per_User__c}"/>
       <apex:column headerClass="headerbackgroundgrey" headerValue="Total/Month" value="{!coon.Cost_Total__c}"/>  
       </tr>
   </apex:dataTable>  
</table>   
</html> 
</apex:page>

 

Here are my 2 classes

 

public with sharing class OngoingCostsList {
    public OngoingCostsList(ApexPages.StandardController controller) {
    }
    List<Project_Cost__c> myList;
    Public List<Project_Cost__c> getOngoingCostsList() {
        myList = [
        SELECT Id, Name, Type__c, Product_For_Sale__c, Amount_Per_Hour__c, Hours__c, Cost_Total__c, URL__c, Amount_Per_User__c, Description__c, Number_Of_Users__c, Product_Name__c, Cost_Total_Dollars__c FROM Project_Cost__c 
        WHERE Type__c = 'On Going' 
        ORDER BY Name DESC 
        ];
    /// ORDER BY CAN BE ASC OR DESC    
    return  myList;
    }     
}

 

 

public class SetupCostsList {
    public SetupCostsList(ApexPages.StandardController controller) {
    }
    List<Project_Cost__c> myList;
    Public List<Project_Cost__c> getSetupCostsList() {
        myList = [SELECT Id, Name, Type__c, Product_For_Sale__c, Amount_Per_Hour__c, Hours__c, Cost_Total__c, URL__c, Amount_Per_User__c, Description__c, Number_Of_Users__c, Product_Name__c, Cost_Total_Dollars__c FROM Project_Cost__c WHERE Type__c = 'Setup' ORDER BY Name DESC ];
    /// ORDER BY CAN BE ASC OR DESC  
    return  myList;
    }      
}

 

Thank you in advance


David

 

 

hi,

 

i had a visual force page with dependencies on it  and in my vf page  i had a input filed which should not appear and i cant delete that field as it is controlling the dependecies can i just hide that field and how can i do it.

 

this is my field code

<apex:inputField id="LOB" value="{!wrapper.ocr.Line_of_Business__c}" style="width:300px"/>

 

thanks

akhil 

  • October 27, 2011
  • Like
  • 0

I need help on the scripting to add multiple line items in an invoice. This is to store many line items one by one after clicking a button  for example 'Add More'

Hi all, 

 

Here is the scenario, We have a contract object to which contract line items is a child object. We want to add multiple contract line items to the contract object. Contract line items are nothing but the products with some extra fields. Like we add opp line items to the opportunities as in standard functionality. Can we do this for my scenario using apex and visualforce. Is this possible? 

 

Thanks in advance 

 

--VPrakash

I am looking to create a Visualforce page that will serve as a data collection form on our website.  The user will ultimately be creating a contact record (linked to an existing account via a lookup) and then several child records (inquiry history, extra curricular interests, family relationships, etc.)  I would like the user to have the ability to create more than one of any of these child records during this process.

 

Visual:

 

Contact (1)
--Inquiry History (1)
--Extra Curricular Interests (Many)
--Family Relationships (Many)
--Test Scores (Many)

 

1)  Is this feasible?

2) What technique is best suited for this type of action?

 

Hi All,

 

I have created a visualforce page in site and i send mails to contacts to register for an event.

Then the contacts click on the link in mail which leads them to the visuaforce page of site i created.

 

Now when they see the page, i dont want them to enter all the values like event name and time.

These event name & time fields should get prefilled when they click to register in their mails which takes them to  visualforce page of the site.

 

How can i achieve this ? please help.

Hi

 

I have a VF page where in I am using case standard controller.

The first time when the page is displayed 2 input fields (eg.) are there i.e. Name and Email. which are static. Another 2 fields are their like Vendor Name and Vendor Contact No. which are dynamic.

 

Now, I want to implement the functionality wherein if a user clicks on Add Row button,  1more row will appear to enter a value in both  the fields(Vendor name and Vendor Contact No.). So, if he clicks the button 5 times, 5 rows shud appear with thses two columns.

After providing the inputs, he will click on "Save " button, and the record should be saved wherein the inputs provided in multiple rows should be saved into the related list of the Case detail page (Case details page will contain the information like Name and Email). Request you to please forward me the code for the above mentioned functionality. Since its a n urgent requirement. An early reply will be highly appreciated. Thanks.

  • May 07, 2010
  • Like
  • 0
Hello,

I put an override on the "View" link for one of my custom objects. I'm sending people to a custom Visualforce page when they choose to View a record from a list view. I am trying to re-create the record detail page in Visualforce and want to put a "Back to List: [Object Name]" link right under the sectionHeader - just like you would see on a standard record detail page. I think you can do this using the "apex:commandLink" component, but cannot figure out what the correct syntax is. Does anyone know how to do this in Visualforce?

Thanks,

Rob