• raji devi 1
  • NEWBIE
  • 60 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 12
    Replies
Hi All, 
I am generating a pdf . the content on  the pdf is dynamic images of different products.In my code i have two tables.
i want to fit the content of one page , but in my pdf content is going to other page .My all product images are >=150px.
I used CSS class to fix the table but i am getting black color blocks at end of the page.
Please help me.
Thanks and Regards,
Raji
<apex:page standardcontroller="Quote" sidebar="false" showHeader="false" renderAs="pdf" applyBodyTag="false" standardStylesheets="true" >

<head>
<style type="text/css" >
@page {
/* Landscape orientation */
/* size:landscape; */
/* Portrait orientation */
size:portrait;
margin:190px 50px 60px 50px;
background:#fff;
 @top-center {
 content: element(header);
}
@bottom-left {
 content: element(footer);
}
}

<!---------by kdfld
applyHtmlTag="false" docType="html-5.0"
@media print {
    table tbody tr td:before,
    table tbody tr td:after {
        content : "" ;
        height : 4px ;
        display : block ;
    }
}
end kjksa--------->


div.footer {
    display: block;
    padding: 0px;
    position: running(footer);
    background: #fff;
    height: 75px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    padding: 10px 0 0 0;
}
div.header {
    display: block;
    position: running(header);
    background: #fff;
    height: 190px;
    padding: 0px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
}
div.content {
    background: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 50%;
}
.pagenumber:before {
    content: counter(page);
}
.pagecount:before {
    content: counter(pages);
}
.allFontsize {
    font-family:Arial, Helvetica, sans-serif;
    font-size:12px;
"
}
  

</style>


<style>
    table.print-friendly tr td, table.print-friendly tr th {
        page-break-inside: avoid;
    }
</style>



<!------------added by raji--------------------
<style type="text/css">


 table { page-break-inside:auto }
   tr    { page-break-inside:avoid; page-break-after:auto }
.p {
        page-break-inside: avoid;
    }
   table { page-break-inside:auto }
   tr    { page-break-inside:avoid; page-break-after:auto }

</style>
<style type="text/css">


@media print {

    p {
        page-break-inside: avoid;
    }
}
</style>------------------------------------->


</head>


<div class="header">
    <apex:image value="{!$Resource.askagroupHeader}" height="186" width="700"/>
  </div>
  <div class="footer">
    <apex:image value="{!$Resource.askagroupFooter}" height="46" width="700"/>
  </div>
  <div class="content" > 
    <!-- Quote Format Start --> 
 
    <!-- Quote Format End --> 
    
    <!-- Industrial Quote Format Start-->
    <table width="700" border="0" align="center" cellpadding="0" cellspacing="0" style="font-family:Arial, Helvetica, sans-serif;font-size:12px;" class="print-friendly">
      <tr>
        <td align="center" valign="middle"><h2><u>QUOTATION</u></h2></td>
      </tr>
      <tr>
        <td height="25" align="left" valign="middle">Ref: {!Quote.QuoteNumber} </td>
      </tr>
      <tr>
        <td height="25" align="left" valign="middle">Dt.:
          <apex:outputText value="{0,date,dd'/'MM'/'yyyy}">
            <apex:param value="{!Quote.CreatedDate}"/>
          </apex:outputText></td>
      </tr>
      <tr>
        <td height="30" align="left" valign="middle">&nbsp;</td>
      </tr>
      <tr>
        <td align="left" valign="middle"><u>Company Name &amp; Address</u></td>
      </tr>
      <tr>
        <td align="left" valign="middle">Address Line1: {!Quote.BillingName} </td>
      </tr>
      <tr>
        <td align="left" valign="middle">Address Line2: {!Quote.BillingStreet} </td>
      </tr>
      <tr>
        <td align="left" valign="middle">Address Line3: {!Quote.BillingCity} </td>
      </tr>
      <tr>
        <td align="left" valign="middle">Contact Ph.: {!Quote.Phone} </td>
      </tr>
      <tr>
        <td align="left" valign="middle">Contact Mob.: {!Quote.Mobile__c} </td>
      </tr>
      <tr>
        <td align="left" valign="middle">Email: {!Quote.Email} </td>
      </tr>
      <tr>
        <td height="30" align="left" valign="middle">&nbsp;</td>
      </tr>
      <tr>
        <td align="left" valign="middle">Kind Attn.: {!Quote.Contact.Name} </td>
      </tr>
      <tr>
        <td align="left" valign="middle">Ref. No.: {!Quote.Ref_No__c} </td>
      </tr>
      <tr>
        <td align="left" valign="middle">Sub.: <strong>{!Quote.Name}</strong></td>
      </tr>
      <tr>
        <td height="25" align="left" valign="middle">&nbsp;</td>
      </tr>
      <tr>
        <td align="left" valign="middle">Dear Sir/Madam,</td>
      </tr>
      <tr>
        <td align="left" valign="middle">&nbsp;</td>
      </tr>
      <tr>
        <td align="left" valign="middle">We thankfully acknowledge receipt of your valued enquiry and as accordingly we are pleased to submit our formal Quotation with reference to your RFQ as under:-</td>
      </tr>
      <tr>
        <td align="left" valign="middle">&nbsp;</td>
      </tr>
      <tr>
        <td align="left" valign="middle"><table width="700" border="1" cellspacing="0" cellpadding="0" bgcolor="#000" style="min-width:700px;max-width:700px; ">
            <tr>
              <th align="center" valign="middle" bgcolor="#FFFFFF" height="30">Line Item</th>
              <th align="center" valign="middle" bgcolor="#FFFFFF">Product Description</th>
              <th align="center" valign="middle" bgcolor="#FFFFFF">Part Code</th>
              <th align="center" valign="middle" bgcolor="#FFFFFF">UOM</th>
              <th align="center" valign="middle" bgcolor="#FFFFFF">Qty</th>
              <th align="center" valign="middle" bgcolor="#FFFFFF">MOQ</th>
              <th align="center" valign="middle" bgcolor="#FFFFFF">Price</th>
              <th align="center" valign="middle" bgcolor="#FFFFFF">Value</th>
              <th align="center" valign="middle" bgcolor="#FFFFFF">Image</th>
            </tr>
            <apex:repeat var="lineItemObj" value="{!Quote.QuoteLineItems}">
              <tr >
                <td align="left" valign="middle" bgcolor="#FFFFFF" >{!lineItemObj.Product2.Name}</td>
                <td align="left" valign="middle" bgcolor="#FFFFFF" ><apex:outputField value="{!lineItemObj.Product2.Description}" styleClass="p"/></td>
                <td align="left" valign="middle" bgcolor="#FFFFFF">{!lineItemObj.Product2.ProductCode}</td>
                <td align="left" valign="middle" bgcolor="#FFFFFF" >{!lineItemObj.UOM__c}</td>
                <td align="left" valign="middle" bgcolor="#FFFFFF" >{!lineItemObj.Quantity}</td>
                <td align="left" valign="middle" bgcolor="#FFFFFF" >{!lineItemObj.MOQ__c}</td>
                <td align="left" valign="middle" bgcolor="#FFFFFF">{!lineItemObj.ListPrice}</td>
                <td align="left" valign="middle" bgcolor="#FFFFFF" >{!lineItemObj.Quote.Grand_Total__c}</td>
                <td align="left" valign="middle" bgcolor="#FFFFFF" width="180" ><apex:outputField value="{!lineItemObj.Product2.Image__c}" style="width:200px; page-break-inside:avoid" /></td>
              </tr>
            </apex:repeat>
          </table>
          <br clear="right" />
          </td>
      </tr>
      <tr>
        <td align="left" valign="middle">&nbsp;</td>
      </tr>
      <tr>
        <th align="left" valign="middle"><em>Product Datasheet attached.</em></th>
      </tr>
      <tr>
        <td align="left" valign="middle">&nbsp;</td>
      </tr>
      <tr>
        <td align="left" valign="middle"><apex:outputPanel id="termsConds" rendered="{!Quote.Terms_Conditions__c}" >
            <table width="100%" border="0" cellspacing="0" cellpadding="0" >
              <tr>
                <th align="left" valign="middle" styleClass="allFontsize"><u><em>Please refer to our terms and conditions next page…</em></u></th>
              </tr>
              <tr>
                <td align="left" valign="middle">&nbsp;</td>
              </tr>
              <tr>
                <th align="left" valign="middle" styleClass="allFontsize"><u>Terms &amp; conditions</u></th>
              </tr>
              <tr>
                <td align="left" valign="middle">&nbsp;</td>
              </tr>
              <tr>
                <td align="left" valign="middle" styleClass="allFontsize"><table width="100%" border="1" cellspacing="1" cellpadding="5" bgcolor="#000000" >
                    <tr>
                      <td width="6%" align="center" valign="middle" bgcolor="#FFFFFF">1.</td>
                      <td width="18%" align="left" valign="top" bgcolor="#FFFFFF">Prices</td>
                      <td width="76%" align="left" valign="top" bgcolor="#FFFFFF"> {!Quote.Price_Term__c} <br/></td>
                    </tr>
                    <tr>
                      <td align="center" valign="middle" bgcolor="#FFFFFF">2.</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">P&amp;F Charges</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">Extra @ 2%</td>
                    </tr>
                    <tr>
                      <td align="center" valign="middle" bgcolor="#FFFFFF">3.</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">Excise Duty</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">Not Applicable</td>
                    </tr>
                    <tr>
                      <td align="center" valign="middle" bgcolor="#FFFFFF">4.</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">Sales Tax</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF"> CST @ {!Quote.CST_Tax__c}% <br/></td>
                    </tr>
                    <tr>
                      <td align="center" valign="middle" bgcolor="#FFFFFF">5.</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">C Form</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">If purchaser to submit Form C, then ASKA C Form Policy will be applicable. Purchaser will be required to deposit the differential tax amount to our Account, i.e., 3% in case of supply from Delhi &amp; 12.5 % in case of supply from Roorkee, along with an interest @1.25% for 6 months on the differential tax amount. <br />
                        <br />
                        Along with the Security Deposit, purchaser will also have to submit us a Declaration as per Annexure I to our Delhi Office.</td>
                    </tr>
                    <tr>
                      <td align="center" valign="middle" bgcolor="#FFFFFF">6.</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">Payment Terms</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">100% Advance against PI before dispatch.</td>
                    </tr>
                    <tr>
                      <td align="center" valign="middle" bgcolor="#FFFFFF">7.</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">Freight Charges</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">Extra at actuals.</td>
                    </tr>
                    <tr>
                      <td align="center" valign="middle" bgcolor="#FFFFFF">8.</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">Insurance</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF"> {!Quote.Insurance__c} <br /></td>
                    </tr>
                    <tr>
                      <td align="center" valign="middle" bgcolor="#FFFFFF">9.</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">Octroi / Entry Tax</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">(If applicable) Extra at actual at your end</td>
                    </tr>
                    <tr>
                      <td align="center" valign="middle" bgcolor="#FFFFFF">10.</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">Road Permit/ Waybill</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">If applicable then 01 No. Road Permit/ Way Bill should be provided along with PO.</td>
                    </tr>
                    <tr>
                      <td align="center" valign="middle" bgcolor="#FFFFFF">11.</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">Dispatch Period</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">{!Quote.Dispatch_Period__c}</td>
                    </tr>
                    <tr>
                      <td align="center" valign="middle" bgcolor="#FFFFFF">12.</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">Warranty</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">12 months (One Year) from the date of receipt at site. Consumable items not covered.</td>
                    </tr>
                    <tr>
                      <td align="center" valign="middle" bgcolor="#FFFFFF">13.</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">Validity</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">45 days from the date of our offer.</td>
                    </tr>
                    <tr>
                      <td align="center" valign="middle" bgcolor="#FFFFFF">14.</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">Bank Guarantee</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">NO Bank Guarantee/ PBG will be submitted by Aska.</td>
                    </tr>
                    <tr>
                      <td align="center" valign="middle" bgcolor="#FFFFFF">15.</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">Delivery Mode</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF"> {!Quote.Delivery_Mode__c} <br /></td>
                    </tr>
                    <tr>
                      <td align="center" valign="middle" bgcolor="#FFFFFF">16.</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">Any other terms:</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">{!Quote.Any_other_terms__c} </td>
                    </tr>
                    <tr>
                      <td align="center" valign="middle" bgcolor="#FFFFFF">17.</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">Comments:</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">{!Quote.Comments__c} </td>
                    </tr>
                  </table></td>
              </tr>
            </table>
          </apex:outputPanel></td>
      </tr>
      <tr>
        <td align="left" valign="middle">&nbsp;</td>
      </tr>
      <tr>
        <th align="left" valign="middle"><u>Note:</u></th>
      </tr>
      <tr>
        <td align="left" valign="middle">&nbsp;</td>
      </tr>
      <tr>
        <td align="left" valign="middle" style="white-space:normal !important;"><ol type="1" >
            <li style="margin:10px 0;white-space:normal; !important;"><strong>In case of supply from Delhi, your Purchase Order &amp; Road Permit / Waybill should be addressed to: </strong><br />
              M/s. Aska Equipments Ltd., R-482, New Rajendra Nagar, Sir Ganga Ram Hospital Square, Shankar Road, New Delhi Pin – 110 060 India Phone +91 11 49458800 (30 Lines) Fax +91 11 49458844. Email: indsales@askagroup.com. </li>
            <li style="margin:10px 0;white-space:normal !important;"><strong>In case of supply from Roorkee, your Purchase Order &amp; Road Permit / Waybill should be addressed to:</strong> <br />
              M/s. Aska Equipments Ltd., Plot No. C-21, Dev Bhoomi Industrial Estate, Pohana – Iqbalpur Road, Village – Bantakhedi, Tehsil – Roorkee, Dist. Haridwar – 247 668 (Uttarakhand). </li>
            <li style="margin:10px 0;white-space:normal  !important;"><strong>PLEASE SEND YOUR ORIGINAL PURCHASE ORDER ONLY TO NEW DELHI OFFICE FOR FASTER COMMUNICATIONS.</strong><br />
              M/s. Aska Equipments Ltd., R-482, New Rajendra Nagar, Sir Ganga Ram Hospital Square, Shankar Road, New Delhi PIN – 110 060 INDIA Phone +91 11 49458800 (30 Lines) Fax +91 11 49458844 Email: indsales@askagroup.com. </li>
          </ol></td>
      </tr>
      <tr>
        <td align="left" valign="middle">&nbsp;</td>
      </tr>
      <tr>
        <td align="left" valign="middle">We sincerely look forward to your valued Purchase Order that will fetch our prompt and quality attention at all times.</td>
      </tr>
      <tr >
        <td align="left" valign="middle">&nbsp;</td>
      </tr>
      <tr><!-----------------second tble-------------------------------------------------------------------->
        <td align="left" valign="middle"><table width="50%" border="0" cellspacing="0" cellpadding="5" style="border:1px solid #000; page-break-inside: avoid;" >
       

            <tr >
            
              <td width="33%" height="20" align="left" valign="middle">CIN No </td>
              <td width="4%" align="center" valign="middle">:</td>
              <td width="63%" align="left" valign="middle">U29222DL1989PLC148198</td>
            </tr>
            <tr>
              <td height="20" align="left" valign="middle">TIN No </td>
              <td align="center" valign="middle">:</td>
              <td align="left" valign="middle">05001745928</td>
            </tr>
            <tr>
              <td height="20" align="left" valign="middle">PAN No </td>
              <td align="center" valign="middle">:</td>
              <td align="left" valign="middle">AABCA4838Q</td>
            </tr>
            <tr>
              <td height="20" align="left" valign="middle">TAN No </td>
              <td align="center" valign="middle">:</td>
              <td align="left" valign="middle">DELA31278C</td>
            </tr>
            <tr>
              <td height="20" align="left" valign="middle">Service Tax No </td>
              <td align="center" valign="middle">:</td>
              <td align="left" valign="middle">AABCA4838QST004</td>
            </tr>
          </table></td>
      </tr>
      <tr>
        <td align="left" valign="middle">&nbsp;</td>
      </tr>
      <tr>
        <td align="left" valign="middle">&nbsp;</td>
      </tr>
      <tr>
        <td height="100" align="center" valign="bottom" >This is a computer generated offer hence no signature is required.</td>
      </tr>
    </table>
    <!-- Industrial Quote Format End --> 
    
  </div>
 
 
 
</apex:page>


 
Hi All, 
I am generating a pdf .
the content on  the pdf is dynamic images of different products.In my code i have two tables.
i want to fit the content of one page , but in my pdf content is going to other page .My all product images are >=150px
if the product information is not fit into one page i want to move to other page , which should happen when page rendered .
I used "page-break-after:always;" but it is not working & added "fs-table-paginate: paginate;" if i used this i am getting blackblocks end of the pages so i removed. pls find attached my code & help me to over come this.

<apex:page standardcontroller="Quote" sidebar="false" showHeader="false" renderAs="pdf" applyBodyTag="false" standardStylesheets="true">
<apex:form >
<head>
<style type="text/css" >
@page {
/* Landscape orientation */
/* size:landscape; */
/* Portrait orientation */
size:portrait;
margin:190px 50px 60px 50px;
background:#fff;
 @top-center {
 content: element(header);
}
@bottom-left {
 content: element(footer);
}
}
div.footer {
    display: block;
    padding: 0px;
    position: running(footer);
    background: #fff;
    height: 75px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    padding: 10px 0 0 0;
}
div.header {
    display: block;
    position: running(header);
    background: #fff;
    height: 190px;
    padding: 0px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
}
div.content {
    background: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 50%;
}
.pagenumber:before {
    content: counter(page);
}
.pagecount:before {
    content: counter(pages);
}
.allFontsize {
    font-family:Arial, Helvetica, sans-serif;
    font-size:12px;
"
}


  

</style>

<!------------added by raji--------------------
<style type="text/css">


 table { page-break-inside:auto }
   tr    { page-break-inside:avoid; page-break-after:auto }
.p {
        page-break-inside: avoid;
    }
   table { page-break-inside:auto }
   tr    { page-break-inside:avoid; page-break-after:auto }

</style>
<style type="text/css">


@media print {
    p {
        page-break-inside: avoid;
    }
}
</style>------------------------------------->


</head>


<div class="header">
    <apex:image value="{!$Resource.askagroupHeader}" height="186" width="700"/>
  </div>
  <div class="footer">
    <apex:image value="{!$Resource.askagroupFooter}" height="46" width="700"/>
  </div>
  <div class="content" > 
    <!-- Quote Format Start --> 
 
    <!-- Quote Format End --> 
    
    <!-- Industrial Quote Format Start-->
    <table width="700" border="0" align="center" cellpadding="0" cellspacing="0" style="font-family:Arial, Helvetica, sans-serif;font-size:12px;">
      <tr>
        <td align="center" valign="middle"><h2><u>QUOTATION</u></h2></td>
      </tr>
      <tr>
        <td height="25" align="left" valign="middle">Ref: {!Quote.QuoteNumber} </td>
      </tr>
      <tr>
        <td height="25" align="left" valign="middle">Dt.:
          <apex:outputText value="{0,date,dd'/'MM'/'yyyy}">
            <apex:param value="{!Quote.CreatedDate}"/>
          </apex:outputText></td>
      </tr>
      <tr>
        <td height="30" align="left" valign="middle">&nbsp;</td>
      </tr>
      <tr>
        <td align="left" valign="middle"><u>Company Name &amp; Address</u></td>
      </tr>
      <tr>
        <td align="left" valign="middle">Address Line1: {!Quote.BillingName} </td>
      </tr>
      <tr>
        <td align="left" valign="middle">Address Line2: {!Quote.BillingStreet} </td>
      </tr>
      <tr>
        <td align="left" valign="middle">Address Line3: {!Quote.BillingCity} </td>
      </tr>
      <tr>
        <td align="left" valign="middle">Contact Ph.: {!Quote.Phone} </td>
      </tr>
      <tr>
        <td align="left" valign="middle">Contact Mob.: {!Quote.Mobile__c} </td>
      </tr>
      <tr>
        <td align="left" valign="middle">Email: {!Quote.Email} </td>
      </tr>
      <tr>
        <td height="30" align="left" valign="middle">&nbsp;</td>
      </tr>
      <tr>
        <td align="left" valign="middle">Kind Attn.: {!Quote.Contact.Name} </td>
      </tr>
      <tr>
        <td align="left" valign="middle">Ref. No.: {!Quote.Ref_No__c} </td>
      </tr>
      <tr>
        <td align="left" valign="middle">Sub.: <strong>{!Quote.Name}</strong></td>
      </tr>
      <tr>
        <td height="25" align="left" valign="middle">&nbsp;</td>
      </tr>
      <tr>
        <td align="left" valign="middle">Dear Sir/Madam,</td>
      </tr>
      <tr>
        <td align="left" valign="middle">&nbsp;</td>
      </tr>
      <tr>
        <td align="left" valign="middle">We thankfully acknowledge receipt of your valued enquiry and as accordingly we are pleased to submit our formal Quotation with reference to your RFQ as under:-</td>
      </tr>
      <tr>
        <td align="left" valign="middle">&nbsp;</td>
      </tr>
      <tr>
        <td align="left" valign="middle"><table width="700" border="1" cellspacing="0" cellpadding="0" bgcolor="#000" style="min-width:700px;max-width:700px; ">
            <tr>
              <th align="center" valign="middle" bgcolor="#FFFFFF" height="30">Line Item</th>
              <th align="center" valign="middle" bgcolor="#FFFFFF">Product Description</th>
              <th align="center" valign="middle" bgcolor="#FFFFFF">Part Code</th>
              <th align="center" valign="middle" bgcolor="#FFFFFF">UOM</th>
              <th align="center" valign="middle" bgcolor="#FFFFFF">Qty</th>
              <th align="center" valign="middle" bgcolor="#FFFFFF">MOQ</th>
              <th align="center" valign="middle" bgcolor="#FFFFFF">Price</th>
              <th align="center" valign="middle" bgcolor="#FFFFFF">Value</th>
              <th align="center" valign="middle" bgcolor="#FFFFFF">Image</th>
            </tr>
            <apex:repeat var="lineItemObj" value="{!Quote.QuoteLineItems}">
              <tr >
                <td align="left" valign="middle" bgcolor="#FFFFFF" >{!lineItemObj.Product2.Name}</td>
                <td align="left" valign="middle" bgcolor="#FFFFFF" ><apex:outputField value="{!lineItemObj.Product2.Description}" styleClass="p"/></td>
                <td align="left" valign="middle" bgcolor="#FFFFFF">{!lineItemObj.Product2.ProductCode}</td>
                <td align="left" valign="middle" bgcolor="#FFFFFF" >{!lineItemObj.UOM__c}</td>
                <td align="left" valign="middle" bgcolor="#FFFFFF" >{!lineItemObj.Quantity}</td>
                <td align="left" valign="middle" bgcolor="#FFFFFF" >{!lineItemObj.MOQ__c}</td>
                <td align="left" valign="middle" bgcolor="#FFFFFF">{!lineItemObj.ListPrice}</td>
                <td align="left" valign="middle" bgcolor="#FFFFFF" >{!lineItemObj.Quote.Grand_Total__c}</td>
                <td align="left" valign="middle" bgcolor="#FFFFFF" width="180"><apex:outputField value="{!lineItemObj.Product2.Image__c}" style="width:200px;pagreak-after:always;"   /></td>
              </tr>
            </apex:repeat>
          </table>
          <br clear="right" />
          </td>
      </tr>
      <tr>
        <td align="left" valign="middle">&nbsp;</td>
      </tr>
      <tr>
        <th align="left" valign="middle"><em>Product Datasheet attached.</em></th>
      </tr>
      <tr>
        <td align="left" valign="middle">&nbsp;</td>
      </tr>
      <tr>
        <td align="left" valign="middle"><apex:outputPanel id="termsConds" rendered="{!Quote.Terms_Conditions__c}" >
            <table width="100%" border="0" cellspacing="0" cellpadding="0" >
              <tr>
                <th align="left" valign="middle" styleClass="allFontsize"><u><em>Please refer to our terms and conditions next page…</em></u></th>
              </tr>
              <tr>
                <td align="left" valign="middle">&nbsp;</td>
              </tr>
              <tr>
                <th align="left" valign="middle" styleClass="allFontsize"><u>Terms &amp; conditions</u></th>
              </tr>
              <tr>
                <td align="left" valign="middle">&nbsp;</td>
              </tr>
              <tr>
                <td align="left" valign="middle" styleClass="allFontsize"><table width="100%" border="1" cellspacing="1" cellpadding="5" bgcolor="#000000" >
                    <tr>
                      <td width="6%" align="center" valign="middle" bgcolor="#FFFFFF">1.</td>
                      <td width="18%" align="left" valign="top" bgcolor="#FFFFFF">Prices</td>
                      <td width="76%" align="left" valign="top" bgcolor="#FFFFFF"> {!Quote.Price_Term__c} <br/></td>
                    </tr>
                    <tr>
                      <td align="center" valign="middle" bgcolor="#FFFFFF">2.</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">P&amp;F Charges</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">Extra @ 2%</td>
                    </tr>
                    <tr>
                      <td align="center" valign="middle" bgcolor="#FFFFFF">3.</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">Excise Duty</td>
                      <td align="left" valign="top" bgcolor="#FFFFFF">Not Applicable</td>
                    </tr>
                    <tr>

User-added image

 Thanks,
Raji
Hi All,
I have a senariou like this, i have  a picklist and a Checkbox  (both custom field). when we select checkbox true then i need to do picklist mandatory?
Please help me.

Thanks,
Rji
Hi All,
My senariou like this .. I have check box and custom date  field when we select checkbox then the record going to save as current date. it was done by workflow field update . But the probleam is Date field is editable.

i want to locked the date field(Custom date) so that no one can change the date.I have make the checkbox read only through Edit Layout  but still it's editable.
 
is there any other way to make the date field read only?

Thanks,
Raji
Hi All,
I have a senariou like this, i have  Created Date field(custom field)  and   Expire Date __c (Formal Datefield). For Example Created date is 6/09/2016 then the Expiredate__c should add 15 working days(30/06/2016) (exclude sunday and saturday) to CreatedDate__C.
My logic for this is :
 CASE( MOD( date - DATE( CreatedDate__C ), 7 ),
3, date + 2 + 15,
4, date + 2 + 15,
5, date + 2 + 15,
6, date + 1 + 15,
   date + 15
)
But it is not working proparly. Any one please help me to over come this.

Thanks and Regards,
Raji
Hi All,
Thanks in advance.
I have written a trigger on solution object Sample code below. Mysenariou islike this : we are saving the records in solution object defaulty the status field (picklist) value is Draft. When it changed to'Duplicate'then   solution Detail (Rich Text Area) also update to 'Duplicate' ?

    trigger solutiontest on Solution(after update){    
    
     set<id> solutionids= new set<id>();
      for(solution s : trigger.new){
          solutionids.add(s.id);
      
      }  
            
        list<solution> slist =[select id,SolutionNote, status from solution where id in : solutionids];
            for(Solution s : slist){
            if(s.status == 'Duplicate'){
                s.SolutionNote= s.status;
               slist.add(s); 
            }    
        
        }
        
        update slist;
          
    
    }

Thanks and Regards,
Raji
Hi All,
Thanks in advance. 
I found a link about how to create pivot report iby using Java Script but i am uable to create, can you please help me to over come this.
https://success.salesforce.com/ideaView?id=08730000000BpyQ
How to create pivot reports with out javascript ? what is the use of pivot report?
Thanks and Regards,
Raji
Hi All,
1. I would like to know the difference bwt managed and unmanaged packages ?
2. what i know in  unmanaged packages, we can use only the features (objects , classes, triggers etc) but we cannt perform custamization.But i need to create reports on visualforce tabs in unmanaged package, can we do that?
Please give me help or links
Thanks in Advance

Thanks,
Raji

 
I am not getting any error  on opportunity object and created task,but the same code is not working on contact
it giving error like this
exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, Related To ID: id value of incorrect type: 0032800000NuHm0AAF: [WhatId]: T
Thanks in advance ,  Please give me solution for this 
trgger autocreatetask on Contact (after  insert , after update)  {
  
    list<task> tasklist = new list<task>();    
        for(contact con : trigger.new){
          task t = new task();
          t.whatid=con.id;
          t.Status = 'In Progress';
          t.Subject='call';
          t.Priority = 'High';
          t.ownerid= con.ownerid;

            tasklist.add(t);
        }
        
        insert tasklist ;     
    
    }
The following is my trigger code i written test class for this, i coverd upto 80% i wand to make it 100% can you help me to fulfill this.

trigger createaccount on Contact (before insert, before update) {
string sp =' ';

if(trigger.isinsert && trigger.isbefore ){
    
    
//add error messages to select only accountid or checkbox
        for(contact con : trigger.new){
            if(con.accountid != null && con.Create_New_Account__c ==true){
            
                con.addError('Enter only account name or create account checkbox true');
                
            }
            if(con.firstname == null)
                con.adderror('FirstName is madatory');
                 
        }
        
}

    if(Trigger.isInsert && Trigger.isBefore ){    
        set<id> stid = new set<id>();
        list<contact>con=trigger.new;
        for(contact cn : con)
        {
            if(string.isnotblank(cn.Staging_ID__c) && cn.FirstName!= null && cn.LastName!=null)
            {
                stid.add(cn.Staging_ID__c);
                cn.firstname=cn.FirstName.subString(0 ,1).ToUpperCase()+cn.FirstName.subString(1);
               cn.lastname=cn.LastName.subString(0 ,1).ToUpperCase()+cn.LastName.subString(1);
               }
        }
        
        list<ProfileStaging__c> pslist = [select id , Profile_Created__c from ProfileStaging__c where id in : stid];
        for(ProfileStaging__c ps : pslist)
        {
         
            ps.Profile_Created__c = true;
            
        }update pslist;
    }
   
 
    if(Trigger.isInsert && Trigger.isBefore ){    
       
        
        List<Account> acclist = new List<Account>();
      
        Map<String,Account > accountMap = new Map<String,Account >();
        for(Contact c:Trigger.New){
         if(c.FirstName!= null && c.LastName!=null)
         {
        if(c.Create_New_Account__c == True){
       
        Account acc = new Account();
       // c.idmaping__c=c.id;
        
        acc.name =c.FirstName.subString(0 ,1).ToUpperCase()+c.FirstName.subString(1)+sp+ c.LastName.subString(0 ,1).ToUpperCase()+c.LastName.subString(1)+sp+ 'Family';
        
        acclist.add(acc);
        }
        
        }
        if(!acclist.isEmpty())
        insert acclist;
       
        }
        for(Account acc : acclist) {
            System.debug('accName===>'+acc.name);
            accountMap.put(acc.name,acc);
        }
        for(Contact c:Trigger.New){
            if(c.Source_temp__c != null)
            {
                c.Source__c= c.Source_temp__c;
            }
            if(c.Create_New_Account__c == True) {
                 if(c.FirstName!= null && c.LastName!=null)
                {
               c.AccountId = accountMap.get(c.FirstName.subString(0 ,1).ToUpperCase()+c.FirstName.subString(1)+sp+ c.LastName.subString(0 ,1).ToUpperCase()+c.LastName.subString(1)+sp+ 'Family').id;
                c.Create_New_Account__c = False;
               }
            }
        }
    }
   
}
************************************************************* my test class is*******************************************
@istest
public class triggerAccCreatedwtihFamilyTest{
    static testmethod void unittestmethod(){
Test.startTest();
           
        contact c = new contact();
        c.lastname='test';
        c.firstname = 'testfirtname';
        c.Potential_Non_Potential__c ='p';
        c.Personal_Email__c ='raji@gmail.com';
        c.Create_New_Account__c=true;
        c.Pincode__c= '500045';
         insert c;
        
   Test.stopTest();
           
        }
    
}
Hi All,

I have contact object with 1 lookup Account name field and create_account__C  checkbox custom field  in it.(I have a trigger on this if check box is checked  account is created, i.e every contact has account record)
My scenario goes in this way-
1. If User selects both the lookup field and check box in detail page and Click on Save, it should throw the Validation Error to select any one of lookup or check box  instead of both
2. if user didnot select lookup field and check box in detail page and click on save , it should throw the validation error to select any one of lookup and check box

Thanks in advance.



 
Hi,
on product object we have currency__c picklist  (INR, USA, etc)and pricebooke also  have same currency__c(India, USA etc) picklist of same currencies. i created pircebooks  depends on picklist values. I am unable to map the related product to related pirce books records.
exm: if product is INR , it go and store to Indian pricebook( For this i am using ID mapping )
Here i am posting my code, Give me solutions for this, Thanks in advance


trigger Createdefaultpricebook on Product2 (after insert) {

 list<pricebookentry> z = new list<pricebookentry>();
    list<product2> produ = new list<product2>();
    
    sobject priceb = [select id, name from pricebook2 where isstandard = true];
    for(product2 p : trigger.new){
    pricebookentry pbe =new pricebookEntry();
    pbe.product2id= p.id;
    pbe.pricebook2id = priceb.id;
    pbe.unitprice = 0.00;
    pbe.isactive = true;
    pbe.UseStandardPrice=false;    
    z.add(pbe);
    }    
    
    insert z;
    
    //id mapping of currencies
    map<id, pricebook2> pbmap = new map<id, pricebook2>();
    list<pricebook2 > pbl = [select id, name from pricebook2 where CurrencyType__c !=null];
   for(pricebook2 pb : pbl){
    
    pbmap.put(pb.id, pb);
   }
   system.debug('***********'+ pbmap);
    
    id  indiaidpb = '01s28000007GbZ9AAK';
    id  usaidpb = '01s28000007Gby5AAC';
    id  euroidpb = '01s28000007GbyFAAS'; 
    id  yenumpb = '01s28000007GbyKAAS';
    id  englandidpb = '01s28000007GbyPAAS';
    
    
    list<pricebookentry> lispbe = new list<pricebookentry >();
    for(product2 p : trigger.new){  
   if(p.CurrencyType__c == 'INR'){
        pricebookentry custompric = new pricebookentry();   
        custompric.pricebook2id = '01s28000007GbZ9AAK';
        custompric.product2id = p.id;
        custompric.unitprice = 0.00;
        custompric.isactive = true;
        lispbe.add(custompric);
  
    }
    
    else if(p.CurrencyType__c == 'USD'){
    
        pricebookentry custompric = new pricebookentry();   
        custompric.pricebook2id = '01s28000007Gby5AAC';
        custompric.product2id = p.id;
        custompric.unitprice = 0.00;
        custompric.isactive = true;
        lispbe.add(custompric);
    
    }
    
         else if(p.CurrencyType__c == 'ERO'){
    
        pricebookentry custompric = new pricebookentry();   
        custompric.pricebook2id = '01s28000007GbyFAAS';
        custompric.product2id = p.id;
        custompric.unitprice = 0.00;
        custompric.isactive = true;
        lispbe.add(custompric);
    
    }
    
         else if(p.CurrencyType__c == 'YEN'){
    
        pricebookentry custompric = new pricebookentry();   
        custompric.pricebook2id = '01s28000007GbyKAAS';
        custompric.product2id = p.id;
        custompric.unitprice = 0.00;
        custompric.isactive = true;
        lispbe.add(custompric);
    
    }
    
         else if(p.CurrencyType__c == 'POUND'){
    
        pricebookentry custompric = new pricebookentry();   
        custompric.pricebook2id = '01s28000007GbyPAAS';
        custompric.product2id = p.id;
        custompric.unitprice = 0.00;
        custompric.isactive = true;
        lispbe.add(custompric);
    
    }
    
    }
    
    insert lispbe;
    

}

 
Hi All,
I have a senariou like this, i have  a picklist and a Checkbox  (both custom field). when we select checkbox true then i need to do picklist mandatory?
Please help me.

Thanks,
Rji
Hi All,
My senariou like this .. I have check box and custom date  field when we select checkbox then the record going to save as current date. it was done by workflow field update . But the probleam is Date field is editable.

i want to locked the date field(Custom date) so that no one can change the date.I have make the checkbox read only through Edit Layout  but still it's editable.
 
is there any other way to make the date field read only?

Thanks,
Raji
Hi All,
I have a senariou like this, i have  Created Date field(custom field)  and   Expire Date __c (Formal Datefield). For Example Created date is 6/09/2016 then the Expiredate__c should add 15 working days(30/06/2016) (exclude sunday and saturday) to CreatedDate__C.
My logic for this is :
 CASE( MOD( date - DATE( CreatedDate__C ), 7 ),
3, date + 2 + 15,
4, date + 2 + 15,
5, date + 2 + 15,
6, date + 1 + 15,
   date + 15
)
But it is not working proparly. Any one please help me to over come this.

Thanks and Regards,
Raji
Hi All,
Thanks in advance.
I have written a trigger on solution object Sample code below. Mysenariou islike this : we are saving the records in solution object defaulty the status field (picklist) value is Draft. When it changed to'Duplicate'then   solution Detail (Rich Text Area) also update to 'Duplicate' ?

    trigger solutiontest on Solution(after update){    
    
     set<id> solutionids= new set<id>();
      for(solution s : trigger.new){
          solutionids.add(s.id);
      
      }  
            
        list<solution> slist =[select id,SolutionNote, status from solution where id in : solutionids];
            for(Solution s : slist){
            if(s.status == 'Duplicate'){
                s.SolutionNote= s.status;
               slist.add(s); 
            }    
        
        }
        
        update slist;
          
    
    }

Thanks and Regards,
Raji
Hi All,
1. I would like to know the difference bwt managed and unmanaged packages ?
2. what i know in  unmanaged packages, we can use only the features (objects , classes, triggers etc) but we cannt perform custamization.But i need to create reports on visualforce tabs in unmanaged package, can we do that?
Please give me help or links
Thanks in Advance

Thanks,
Raji

 
I am not getting any error  on opportunity object and created task,but the same code is not working on contact
it giving error like this
exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, Related To ID: id value of incorrect type: 0032800000NuHm0AAF: [WhatId]: T
Thanks in advance ,  Please give me solution for this 
trgger autocreatetask on Contact (after  insert , after update)  {
  
    list<task> tasklist = new list<task>();    
        for(contact con : trigger.new){
          task t = new task();
          t.whatid=con.id;
          t.Status = 'In Progress';
          t.Subject='call';
          t.Priority = 'High';
          t.ownerid= con.ownerid;

            tasklist.add(t);
        }
        
        insert tasklist ;     
    
    }
Hi,
on product object we have currency__c picklist  (INR, USA, etc)and pricebooke also  have same currency__c(India, USA etc) picklist of same currencies. i created pircebooks  depends on picklist values. I am unable to map the related product to related pirce books records.
exm: if product is INR , it go and store to Indian pricebook( For this i am using ID mapping )
Here i am posting my code, Give me solutions for this, Thanks in advance


trigger Createdefaultpricebook on Product2 (after insert) {

 list<pricebookentry> z = new list<pricebookentry>();
    list<product2> produ = new list<product2>();
    
    sobject priceb = [select id, name from pricebook2 where isstandard = true];
    for(product2 p : trigger.new){
    pricebookentry pbe =new pricebookEntry();
    pbe.product2id= p.id;
    pbe.pricebook2id = priceb.id;
    pbe.unitprice = 0.00;
    pbe.isactive = true;
    pbe.UseStandardPrice=false;    
    z.add(pbe);
    }    
    
    insert z;
    
    //id mapping of currencies
    map<id, pricebook2> pbmap = new map<id, pricebook2>();
    list<pricebook2 > pbl = [select id, name from pricebook2 where CurrencyType__c !=null];
   for(pricebook2 pb : pbl){
    
    pbmap.put(pb.id, pb);
   }
   system.debug('***********'+ pbmap);
    
    id  indiaidpb = '01s28000007GbZ9AAK';
    id  usaidpb = '01s28000007Gby5AAC';
    id  euroidpb = '01s28000007GbyFAAS'; 
    id  yenumpb = '01s28000007GbyKAAS';
    id  englandidpb = '01s28000007GbyPAAS';
    
    
    list<pricebookentry> lispbe = new list<pricebookentry >();
    for(product2 p : trigger.new){  
   if(p.CurrencyType__c == 'INR'){
        pricebookentry custompric = new pricebookentry();   
        custompric.pricebook2id = '01s28000007GbZ9AAK';
        custompric.product2id = p.id;
        custompric.unitprice = 0.00;
        custompric.isactive = true;
        lispbe.add(custompric);
  
    }
    
    else if(p.CurrencyType__c == 'USD'){
    
        pricebookentry custompric = new pricebookentry();   
        custompric.pricebook2id = '01s28000007Gby5AAC';
        custompric.product2id = p.id;
        custompric.unitprice = 0.00;
        custompric.isactive = true;
        lispbe.add(custompric);
    
    }
    
         else if(p.CurrencyType__c == 'ERO'){
    
        pricebookentry custompric = new pricebookentry();   
        custompric.pricebook2id = '01s28000007GbyFAAS';
        custompric.product2id = p.id;
        custompric.unitprice = 0.00;
        custompric.isactive = true;
        lispbe.add(custompric);
    
    }
    
         else if(p.CurrencyType__c == 'YEN'){
    
        pricebookentry custompric = new pricebookentry();   
        custompric.pricebook2id = '01s28000007GbyKAAS';
        custompric.product2id = p.id;
        custompric.unitprice = 0.00;
        custompric.isactive = true;
        lispbe.add(custompric);
    
    }
    
         else if(p.CurrencyType__c == 'POUND'){
    
        pricebookentry custompric = new pricebookentry();   
        custompric.pricebook2id = '01s28000007GbyPAAS';
        custompric.product2id = p.id;
        custompric.unitprice = 0.00;
        custompric.isactive = true;
        lispbe.add(custompric);
    
    }
    
    }
    
    insert lispbe;
    

}