• petergascoyne
  • NEWBIE
  • 25 Points
  • Member since 2009
  • Salesforce Developer (Contract)
  • Cloud P.G. Ltd


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

First of all, Hello Developer Community 

 

I am new here, and to be honest, i need help. I am working with salesforce since almost two years and i am now getting more interested into visualforce. I know this is Apex Code Development, but i think you are the ones how may can help me (If the admins think i am wrong here, feel free to move this topic).

 

So here my Problem:

 

I tested the new Quotes Module, but i am not satisfied with the editor for the PDF Layout. I take a look and found this:

http://appexchange.salesforce.com/listingDetail?listingId=a0N300000017lEqEAI

I don't have Problems with customizing the Page layout, but i noticed that all Opp Line items are not inserted in the Visualforce page like they are sorted in the Opportunity (seems to be sorted by Product Name, alphabetically).

 

What i read so far is that i need a custom controller or maybe just an extension to control the sort order. I created a Custom field for Quote Product Position (Sort_order) which should be the master for sorting the line items.

 

After i tested and played around with all the Code-Examples i found in the web, nothing worked out for me. Now, after almost a week i decided to ask you for a hint, or an example which is almost (or exactly :D ) what i need. I forgot to mention i have almost no programming skills :(

 

Maybe there is also a way to use the sort order of the opportunity itself, that would be the best way, but what i read so far, this is not possible.

 

Here is my Visualforce Page, so you can see my apex:repeat element with all the fields:

 

<apex:page standardController="Opportunity" showHeader="false" renderas="pdf">

<table border="0" cellspacing="0" cellpadding="0" width="100%" id="table1">
<tr>
    <td>
        <img src='{!URLFOR($Resource.YOUR_SL_Logo_quote)}' title="logo" />
    </td>
    <td  align="right"><font face="Arial" >
    <b>Quote  for {!Opportunity.Account.Name}</b></font><br/>
    </td>
    
    
</tr>

<hr/>

</table>
<table border="0" cellspacing="0" cellpadding="0" width="100%" id="table1">
<tr>    <td><font face="Arial" >
        {!$Organization.Name}<br/>
        {!$Organization.Street}<br/>
        {!$Organization.PostalCode} {!$Organization.City}<br/>
        {!$Organization.Country}<br/>
        </font></td> 
        <td width="60%">&nbsp;</td>
   <td ><font face="Arial">Quote number: {!Opportunity.QuoteNumber__c}
   {!Opportunity.QuoteVersion__c}<br/>
        <br/>
        Offer valid Through:&nbsp;<apex:OutputField value="{!Opportunity.CloseDate}"/><br/>    
        Proposed by: {!Opportunity.Owner.LastName} {!Opportunity.Owner.FirstName}</font>
     </td>
</tr>
</table>
<br/>
<hr/>
<p><b><font face="Arial" color="#000080">Address Information</font></b></p>

<table border="0" width="100%" id="table2">
<tr>
       <td colspan="3">
           <font face="Arial">Account name: {!Opportunity.Account.Name} <br/><br/></font>
       </td>
</tr>
<tr>
       <td>          
           <font face="Arial">Bill To:<br/>
                             {!Opportunity.Account.BillingStreet}<br/>
                             {!Opportunity.Account.BillingPostalCode} {!Opportunity.Account.BillingCity}
           </font>
      </td>
        <td width="50%"></td>
        <td >
           <font face="Arial">Ship To:<br/>
                              {!Opportunity.Account.ShippingStreet}<br/>
                              {!Opportunity.Account.ShippingPostalCode} {!Opportunity.Account.ShippingCity}
           </font>
        </td>
</tr>    
</table>
<br/>
<hr/>
<p><b><font color="#000080" face="Arial">Products</font></b></p>
<p>&nbsp;</p>
<table border="0" width="100%" id="table4">
<tr>
       <td ALIGN="left" VALIGN="top"><font face="Arial"><strong>Pos.</strong></font></td>
       <td ALIGN="right" VALIGN="top"><font face="Arial"><strong>Anz.</strong></font></td>
       <td ALIGN="left" VALIGN="top"><font face="Arial"><strong>Einheit</strong></font></td>
       <td ALIGN="left" VALIGN="top"><font face="Arial"><strong>Beschreibung</strong></font></td>
       <td ALIGN="right" VALIGN="top"><font face="Arial"><strong>Einzelpreis</strong></font></td>
       <td ALIGN="right" VALIGN="top"><font face="Arial"><strong>Gesamtpreis</strong></font></td>
</tr>

<tr>
       
       <apex:repeat value="{!Opportunity.OpportunityLineItems}" var="line">
          <tr>
             <td ALIGN="left" VALIGN="top"><strong>{!line.New_Section_on_quote__c}</strong></td>
          </tr> 
          <tr>
             <td ALIGN="left" VALIGN="top"> <p><strong>{!line.Sort_Order__c}</strong></p></td>
             <td ALIGN="right" VALIGN="top"><p>{!line.Quantity}</p></td>
             <td ALIGN="left" VALIGN="top"> <p>{!line.Einheit__c}</p></td>             
             <td ALIGN="left" VALIGN="top"> <p><strong>{!line.PricebookEntry.Name}</strong></p>
                                            <p>{!line.Product_lineitem_description__c}</p></td>
             <td ALIGN="right" VALIGN="top"><p><apex:OutputField value="{!line.UnitPrice}"/></p></td>
             <td ALIGN="right" VALIGN="top"><p><apex:OutputField value="{!line.TotalPrice}"/></p></td>
          </tr>
       </apex:repeat>  
</tr>

<tr>
       <td align="right" colspan="6">
       <font face="Arial"><b>Summe:</b>&nbsp;<apex:OutputField value="{!Opportunity.Amount}"/></font></td>
</tr>
</table>
<br/>
<hr/>
<p><b><font color="#000080" face="Arial">Terms and Conditions</font></b></p>
<table border="0" width="100%" id="table3">
<tr>
        <td><font face="Arial">
        
              Start date:&nbsp;<apex:OutputField value="{!Opportunity.QuoteBeginDate__c}"/><br/>
              Contract End date:&nbsp;<apex:OutputField value="{!Opportunity.QuoteEndDate__c}"/><br/>
            </font>
        </td>
        <td width="50%"></td>
        <td><font face="Arial">
              Payment Method:<apex:OutputField value="{!Opportunity.QuotePaymentMode__c}"/><br/>
              Payment Terms: <apex:OutputField value="{!Opportunity.QuotePaymentTime__c}"/><br/>
              Billing Frequency: <apex:OutputField value="{!Opportunity.QuoteBillingFrequency__c}"/><br/>
            </font>
       </td>
</tr>
</table>
<br/>
<p><font face="Arial">{!Opportunity.Conditions__c}</font></p>
<br/>
<hr/>
<table width="100%" id="table5">
<tr>
   <td width="50%"><b>{!$Organization.Name}</b></td>
   <td width="50%"><b>{!Opportunity.Account.Name}</b></td>
</tr>
<tr>
   <td width="50%">&nbsp;</td>
   <td width="50%">&nbsp;</td>
</tr>
<tr>
   <td width="50%">Signature<hr color="black" size="1"/></td>
   <td width="50%">Signature<hr color="black" size="1"/></td>
</tr>
<tr>
   <td width="50%">Name<hr color="black" size="1"/></td>
   <td width="50%">Name<hr color="black" size="1"/></td>
</tr>
<tr>
   <td width="50%">Title<hr color="black" size="1"/></td>
   <td width="50%">Title<hr color="black" size="1"/></td>
</tr>
<tr>
   <td width="50%">Date<hr color="black" size="1"/></td>
   <td width="50%">Date<hr color="black" size="1"/></td>
</tr>
</table>
<p>&nbsp;</p>
<hr/>
<p align="center"><font face="Arial"><i>Copyright {!$Organization.Name}.</i></font></p>
</apex:page>

 

 

 

Hi people,

 

The problem I have is, I have an application I have been working on and to test it I need a large amount of Custom Objects,  over 100.

 

What would be the best way to create 100 test Custom Objects?

 

Would I be able to quickly add and remove these at anytime?

 

Thanks

 

Peter

Is it possible? It would have saved a lot of effort of writing  similer VF pages of different  controller..

I am creating a VF page to show all accounts and contacts (name, email address) that have an asset that is selected from a picklist.

 

I am having a problem creating the query.  I need to query Accounts, Contacts and Assets.  I can't do it as a Parent - Child because I can only do 1 child.

 

My goal is to have a query that shows all the accounts, and all of the contacts associated with the accounts for a given asset.

 

Any help that I get will be greatly appreciated.

 

Thanks

  • November 07, 2012
  • Like
  • 0

Hi

 

I want to write a trigger (before insert and after update) to set a single field on the Account record which is the concatentation of a field from many child records (from ERP_Account). 

 

For exmaple: if the ACCOUNT record has many ERP_Accounts with the value in field ACCOUNTNO as 'TEST1','TEST2','TEST3' respectively, then I want to set ACCOUNTNOS field in the Account record with the value 'TEST1, TEST2, TEST3,' 

 

Dont know where to start - any help would be greatly appreciated.

 

Thanks

Ross

  • April 15, 2011
  • Like
  • 0

First of all, Hello Developer Community 

 

I am new here, and to be honest, i need help. I am working with salesforce since almost two years and i am now getting more interested into visualforce. I know this is Apex Code Development, but i think you are the ones how may can help me (If the admins think i am wrong here, feel free to move this topic).

 

So here my Problem:

 

I tested the new Quotes Module, but i am not satisfied with the editor for the PDF Layout. I take a look and found this:

http://appexchange.salesforce.com/listingDetail?listingId=a0N300000017lEqEAI

I don't have Problems with customizing the Page layout, but i noticed that all Opp Line items are not inserted in the Visualforce page like they are sorted in the Opportunity (seems to be sorted by Product Name, alphabetically).

 

What i read so far is that i need a custom controller or maybe just an extension to control the sort order. I created a Custom field for Quote Product Position (Sort_order) which should be the master for sorting the line items.

 

After i tested and played around with all the Code-Examples i found in the web, nothing worked out for me. Now, after almost a week i decided to ask you for a hint, or an example which is almost (or exactly :D ) what i need. I forgot to mention i have almost no programming skills :(

 

Maybe there is also a way to use the sort order of the opportunity itself, that would be the best way, but what i read so far, this is not possible.

 

Here is my Visualforce Page, so you can see my apex:repeat element with all the fields:

 

<apex:page standardController="Opportunity" showHeader="false" renderas="pdf">

<table border="0" cellspacing="0" cellpadding="0" width="100%" id="table1">
<tr>
    <td>
        <img src='{!URLFOR($Resource.YOUR_SL_Logo_quote)}' title="logo" />
    </td>
    <td  align="right"><font face="Arial" >
    <b>Quote  for {!Opportunity.Account.Name}</b></font><br/>
    </td>
    
    
</tr>

<hr/>

</table>
<table border="0" cellspacing="0" cellpadding="0" width="100%" id="table1">
<tr>    <td><font face="Arial" >
        {!$Organization.Name}<br/>
        {!$Organization.Street}<br/>
        {!$Organization.PostalCode} {!$Organization.City}<br/>
        {!$Organization.Country}<br/>
        </font></td> 
        <td width="60%">&nbsp;</td>
   <td ><font face="Arial">Quote number: {!Opportunity.QuoteNumber__c}
   {!Opportunity.QuoteVersion__c}<br/>
        <br/>
        Offer valid Through:&nbsp;<apex:OutputField value="{!Opportunity.CloseDate}"/><br/>    
        Proposed by: {!Opportunity.Owner.LastName} {!Opportunity.Owner.FirstName}</font>
     </td>
</tr>
</table>
<br/>
<hr/>
<p><b><font face="Arial" color="#000080">Address Information</font></b></p>

<table border="0" width="100%" id="table2">
<tr>
       <td colspan="3">
           <font face="Arial">Account name: {!Opportunity.Account.Name} <br/><br/></font>
       </td>
</tr>
<tr>
       <td>          
           <font face="Arial">Bill To:<br/>
                             {!Opportunity.Account.BillingStreet}<br/>
                             {!Opportunity.Account.BillingPostalCode} {!Opportunity.Account.BillingCity}
           </font>
      </td>
        <td width="50%"></td>
        <td >
           <font face="Arial">Ship To:<br/>
                              {!Opportunity.Account.ShippingStreet}<br/>
                              {!Opportunity.Account.ShippingPostalCode} {!Opportunity.Account.ShippingCity}
           </font>
        </td>
</tr>    
</table>
<br/>
<hr/>
<p><b><font color="#000080" face="Arial">Products</font></b></p>
<p>&nbsp;</p>
<table border="0" width="100%" id="table4">
<tr>
       <td ALIGN="left" VALIGN="top"><font face="Arial"><strong>Pos.</strong></font></td>
       <td ALIGN="right" VALIGN="top"><font face="Arial"><strong>Anz.</strong></font></td>
       <td ALIGN="left" VALIGN="top"><font face="Arial"><strong>Einheit</strong></font></td>
       <td ALIGN="left" VALIGN="top"><font face="Arial"><strong>Beschreibung</strong></font></td>
       <td ALIGN="right" VALIGN="top"><font face="Arial"><strong>Einzelpreis</strong></font></td>
       <td ALIGN="right" VALIGN="top"><font face="Arial"><strong>Gesamtpreis</strong></font></td>
</tr>

<tr>
       
       <apex:repeat value="{!Opportunity.OpportunityLineItems}" var="line">
          <tr>
             <td ALIGN="left" VALIGN="top"><strong>{!line.New_Section_on_quote__c}</strong></td>
          </tr> 
          <tr>
             <td ALIGN="left" VALIGN="top"> <p><strong>{!line.Sort_Order__c}</strong></p></td>
             <td ALIGN="right" VALIGN="top"><p>{!line.Quantity}</p></td>
             <td ALIGN="left" VALIGN="top"> <p>{!line.Einheit__c}</p></td>             
             <td ALIGN="left" VALIGN="top"> <p><strong>{!line.PricebookEntry.Name}</strong></p>
                                            <p>{!line.Product_lineitem_description__c}</p></td>
             <td ALIGN="right" VALIGN="top"><p><apex:OutputField value="{!line.UnitPrice}"/></p></td>
             <td ALIGN="right" VALIGN="top"><p><apex:OutputField value="{!line.TotalPrice}"/></p></td>
          </tr>
       </apex:repeat>  
</tr>

<tr>
       <td align="right" colspan="6">
       <font face="Arial"><b>Summe:</b>&nbsp;<apex:OutputField value="{!Opportunity.Amount}"/></font></td>
</tr>
</table>
<br/>
<hr/>
<p><b><font color="#000080" face="Arial">Terms and Conditions</font></b></p>
<table border="0" width="100%" id="table3">
<tr>
        <td><font face="Arial">
        
              Start date:&nbsp;<apex:OutputField value="{!Opportunity.QuoteBeginDate__c}"/><br/>
              Contract End date:&nbsp;<apex:OutputField value="{!Opportunity.QuoteEndDate__c}"/><br/>
            </font>
        </td>
        <td width="50%"></td>
        <td><font face="Arial">
              Payment Method:<apex:OutputField value="{!Opportunity.QuotePaymentMode__c}"/><br/>
              Payment Terms: <apex:OutputField value="{!Opportunity.QuotePaymentTime__c}"/><br/>
              Billing Frequency: <apex:OutputField value="{!Opportunity.QuoteBillingFrequency__c}"/><br/>
            </font>
       </td>
</tr>
</table>
<br/>
<p><font face="Arial">{!Opportunity.Conditions__c}</font></p>
<br/>
<hr/>
<table width="100%" id="table5">
<tr>
   <td width="50%"><b>{!$Organization.Name}</b></td>
   <td width="50%"><b>{!Opportunity.Account.Name}</b></td>
</tr>
<tr>
   <td width="50%">&nbsp;</td>
   <td width="50%">&nbsp;</td>
</tr>
<tr>
   <td width="50%">Signature<hr color="black" size="1"/></td>
   <td width="50%">Signature<hr color="black" size="1"/></td>
</tr>
<tr>
   <td width="50%">Name<hr color="black" size="1"/></td>
   <td width="50%">Name<hr color="black" size="1"/></td>
</tr>
<tr>
   <td width="50%">Title<hr color="black" size="1"/></td>
   <td width="50%">Title<hr color="black" size="1"/></td>
</tr>
<tr>
   <td width="50%">Date<hr color="black" size="1"/></td>
   <td width="50%">Date<hr color="black" size="1"/></td>
</tr>
</table>
<p>&nbsp;</p>
<hr/>
<p align="center"><font face="Arial"><i>Copyright {!$Organization.Name}.</i></font></p>
</apex:page>

 

 

 

Hi people,

 

The problem I have is, I have an application I have been working on and to test it I need a large amount of Custom Objects,  over 100.

 

What would be the best way to create 100 test Custom Objects?

 

Would I be able to quickly add and remove these at anytime?

 

Thanks

 

Peter

Is it possible? It would have saved a lot of effort of writing  similer VF pages of different  controller..