• pratyusha raavipati
  • NEWBIE
  • 5 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 1
    Replies
my code of quote class is

public class QuoteConsultingExtension {
  private List<QuoteLineItem> conLineItems;
    private decimal conTotal;
    private decimal lisSave;
    public final Quote myQuote;
    public String cont {get;set;}
    public QuoteConsultingExtension(ApexPages.StandardController stdController) {
        this.myQuote = (Quote)stdController.getRecord();
        Quote q = [select Accountid from quote where id =: myquote.id limit 1];
        Contact con = [select name from contact where Accountid =: q.Accountid limit 1];
        cont = con.name;
    }
   public List<QuoteLineItem> consultingLineItems{
        get{
           if(conLineItems == null)
           {
             //  conLineItems = new List<QuoteLineItem>();
             String aid = ApexPages.CurrentPage().getParameters().get('id');
             conLineItems =[select id,Product2Id,Product2.name,Quantity,ListPrice,UnitPrice,Discount,sub_tol__c,Contract_Months__c from QuoteLineItem where QuoteId = :  aid];
               
           }  
            
          return conLineItems;

        }

       set;
     }
    
    public decimal consultingTotal{
         get{   
             conTotal=0;
             for(QuoteLineItem qli: conLineItems){
                 conTotal += qli.UnitPrice*qli.Quantity*qli.Contract_Months__c;  
             }
         return conTotal;
         } 
         set;
    }
     public decimal listSaved{
         get{   
             lisSave=0;
             for(QuoteLineItem qli: conLineItems){
                 lisSave += qli.ListPrice*qli.Quantity*qli.Contract_Months__c;  
             }
         return lisSave-conTotal;
         } 
         set;
    }
    //This works ok
    public PageReference viewPDF() {
       string quoteId = ApexPages.currentPage().getParameters().get('id');
       PageReference thePDF = Page.QuotePage;
        thePDF.getParameters().put('id',quoteId);
        thePDF.setRedirect(true);
        return thePDF;
       
    }
     
    public PageReference savePDF() {
        string qId = ApexPages.currentPage().getParameters().get('id');
  //The debug show it is retrieving the quote Id in the logs      <br>        
  System.debug(qId);
       PageReference thePDF = new PageReference('/apex/testquotePage?id='+qId); 
     //   PageReference thePDF = viewPDF(); 
   //The debug shows that it's grabbing the correct pagereference in the logs  
        System.debug('PageRefernce' + thePDF);
 //these are commented out but using the try catch was the only way to get it to attach a pdf <br>  // however the pdf is unviewable     
//        Blob pdfBlob;
  //      try{
    //    pdfBlob = thePDF.getContent();
      //  pdfBlob = thePDF.getContentAsPDF();
        //}
        //catch(VisualforceException e){
       // pdfBlob = Blob.valueOf('Blob when occur error');
       // }
       //It error comes when I use the getContentAsPDF() function and it basically is acting as if it's <br>       // Not running the Quote standard constructor which gives you all the fields on the quote object<br>       
        QuoteDocument qd = new QuoteDocument(quoteId = qId, Document = thePDF.getContentAsPDF());
        System.debug('qd : ' + qd);
        insert qd;
        PageReference quotePage = new PageReference('/'+ qId);
        quotePage.setRedirect(true);
        return quotePage;
    }
}

please help me i have to submit this work by eveing please please
 
Hi, 

I have account object with field currency as pick list 

pick list values are

USD
CAD
GBP
EUR


depending on the picklist selected automatically currency have to be updated 
Products and quotes

i mean  for example
i have selected EUR list price in products should be in EUR same in quotes
from past 2 days i am working on this i did not find the way 
please help me

THANKS & REGARDS
PRATYUSHA.K
hi,
actually my requirement was i have so many tasks to complete but i did not completed on this day so have to postphone then to someother day means i want change the date at a time for suppose of 50 tasks

please help me

Thanks & Regards
Pratyusha K
Hi,
this is my code
<apex:page controller="searchaccount">
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection >
<apex:inputText id="searchTextBox" value="{!searchText}">
<p> Enter Account Name</p>
</apex:inputText>
 <apex:commandButton value="search" action="{!result}"/>
</apex:pageBlockSection>
<apex:pageBlockSection >
<apex:pageBlockTable value="{!Account}" var="a">
<apex:column headerValue="Account Name">
<apex:inputField value="{!a.Name}"/>
 </apex:column>
 <apex:column headerValue="Account Number">
<apex:inputField value="{!a.AccountNumber}"/>
 </apex:column>
 <apex:column headerValue="Mobile">
<apex:inputField value="{!a.Phone}"/>
 </apex:column>
 <apex:column headerValue="Fax">
<apex:inputField value="{!a.Fax}"/>
 </apex:column>
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
 </apex:page>


public class searchaccount{

    public String searchText {get; set;}
 
  Account acc {get;set;}
  public List<Account> lstofAccount;

Public searchaccount(){
  acc = new Account();
  lstOfAccount = new List<Account>();

}
 public pagereference Result(){
        
  List<Account> acc =[select Name from Account where Name=:Name];
return null;
}

public String Name { get; set; }
}


and i am getting error
Error: Could not resolve the entity from <apex:inputField> value binding '{!a.Fax}'. <apex:inputField> can only be used with SObjects, or objects that are Visualforce field component resolvable.
i think my visualforce code was correct and i done mistake in apex