• Vandana Rattan
  • NEWBIE
  • 80 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 33
    Questions
  • 37
    Replies
I have a requirement wherein following needs to be implemented:-

For a particular Opportunity Record Type - 

If there are Opportunity Stages A, B, C, D, E, F Team1 should be able to progress the opp till stage C and also to stage F. They should not be able to progress opp to Stages D, E.

Team2 should be able to progress the opp to all stages.

How can I achieve this functionality? I thought of creating multiple Sales Process but this would require me to create multiple Record Types.
I have a requirement to get data from:-

CVent
ExactTarget
Oracle Financials

The info has to be shown in Salesforce on a Visualforce page. I donot want to store any info in SF. How can I achieve this functionality?
I need to implement the following scenario:-

All the cases which have been put on hold should be reassigned to a particular queue. I need this to run every 15 days. I am thinking of addressing this by creating a Time Dependent workflow that would be evaluated:-

1) When a record is created, and any time it’s edited to subsequently meet criteria.
2) Every15 days after Case: Last Modified Date.

Is this the correct way OR do I need to implement this programatically?

How can I take care of my existing cases which are created before the workflow is created?
I need to setup an Approval Process for discounts. The discount field is available on Opportunity Product. However while defining approval process, there is no option to select OpportunityProduct fields.

How can I setup the approval process?
I posted this query on Salesforce Success Community also and am posting it in dev forum again as it is very urgent.

Our Contacts are based on divison (North, South, etc) and share Relationship (a custom object) with Accounts they are related to. The Relationship contains info regarding type of service contact is using. They can be Graduate, fellow, etc. I have to set Targets for different divisions for each type of Service. So targets would be something like:-

North:- Fellow = 22, Graduate = 6
South:- Felow = 50, Graduate = 10

and so on. How can I achieve this? How do I set Targets? I also need to create reports and dashboards to show targets achieved vs actuals.

Any Suggestions?
I have a product Pageblock table. There are some input fields in the table and I need to set default values for these. How can I achieve this? Code is pasted below:-

<apex:column headerValue="{!$ObjectType.OpportunityLineItem.Fields.ServiceDate.Label}">
                        <apex:inputField value="{!s.ServiceDate}" required="false"/>
 </apex:column>

<apex:column headerValue="{!$ObjectType.OpportunityLineItem.Fields.Quantity.Label}">
                    	<apex:inputField value="{!s.Quantity}" style="width:70px" required="true" 
                    </apex:column>


My cases are of different types:- Membership, chartered, etc. My users are assigned the Role Member Services which is a part of Member Services - Campaigns queue. There are no Email Alerts setup and neither are any workflows defined to send email.

A Case Asignment rule is defined which has 2 entries:-

1) Assigns Cases to Marketing Service - Cases queue and sends email alerts
2) Assigns cases to Member Assessment Cases with no email alerts.

The problem is my users under Member Services role are getting multiple Case Assignment notifications which are not valid to them.

How can I resolve this issue?
I have made a custom LeadConvert page. I need to pass following values from the page to the controller. How can I achieve this?

Controller snippet:--

<apex:pageBlockSectionItem >
            <apex:outputLabel for="Subject">Subject</apex:outputLabel>
            <apex:inputField value="{!Task.Subject}" id='tskSubject' >
             	<apex:param value="{!Task.Subject}" assignTo="{!tskSubject}"/>
             </apex:inputField>
          </apex:pageBlockSectionItem>
          <apex:pageBlockSectionItem >
            <apex:outputLabel for="Type">Type</apex:outputLabel>
            <apex:inputField value="{!Task.Type}" id='tskType'/>
          </apex:pageBlockSectionItem>


My org uses an API User to integrate other tools with Salesforce. One more integration requires API User password but I dont know the password. How can I get around this situation?
I have created a changeset that contains only an edit to a URL name in a tab. I am getting errors deploying it in production for test classes which are not even in my changeset. Kindly help.
I have created a Custom Lead Convert Page. I need to show a list of duplicate contacts on Lead Conversion. I have been trying to do so using Apex:Repeat and Apex:PageBlockTable but nothing is getting displayed. My SOQL does return results. Kindly suggest. My Controller and Visualforce Page are given below:-

VisualForce Page:
<apex:page standardController="Lead" extensions="LeadConvertController">
    <apex:includescript value="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" />
     <apex:sectionHeader title="Convert {!$ObjectType.Lead.label}" subtitle="{!Lead.name}"/>
    <apex:form id="leadForm">
        <apex:pageBlock mode="edit" >
       
        <apex:pageblockbuttons >
                <apex:commandbutton value="Convert" action="{!ConvertLead}"/>
                <apex:commandbutton value="Cancel" action="{!Cancel}"/>
        </apex:pageblockbuttons>
        
        <apex:pageblocksection id="LeadConvertPBS" title="Convert Lead">
        	<apex:pageBlockSectionItem >
            <apex:outputLabel value=" Record Owner" for="Record Owner"/>
                <apex:inputField value="{!lead.OwnerID}" id="recOwner1" />
            
          	</apex:pageBlockSectionItem>
            
            <apex:pageBlockSectionItem >
            <apex:outputLabel for="Account Name">Account Name</apex:outputLabel>
             <apex:inputField required="true" id="company" value="{!lead.Company}" />
          </apex:pageBlockSectionItem>
          <apex:pageBlockSectionItem >
           <apex:OutputLabel for="Send Email to the Owner">Send Email to the Owner</apex:OutputLabel>
           <apex:inputCheckbox onclick="{!lead.Ownerid}"/>
           </apex:pageBlockSectionItem> 
          <apex:pageBlockSectionItem >
            <apex:outputLabel for="Oppt Name">Opportunity Name:</apex:outputLabel>
             <apex:inputField required="true" id="opptName" value="{!lead.Company}" />
          </apex:pageBlockSectionItem>
          <apex:pageBlockSectionItem >
                      <apex:outputLabel for="ConStatus">Converted Status:</apex:outputLabel>
             <apex:inputField id="ConStatus" value="{!lead.Status}" />
          </apex:pageBlockSectionItem>
          <apex:pageblockSectionItem >
             <!-- <apex:outputLabel for="no oppty">Do not create new opportunity upon conversion</apex:outputLabel>
              	<apex:inputCheckbox id="noOppty"/>-->
               
          </apex:pageblockSectionItem>
        </apex:pageblocksection> 
        <!--<apex:outputPanel id="contactList" layout="block">
        	<apex:pageBlockSection title="Contact List">
            </apex:pageBlockSection>
            <apex:repeat value="{!lstDupContact}">
				<apex:outputText value="{!lstDupContact}"></apex:outputText>            
            </apex:repeat>
        </apex:outputPanel>-->
        <apex:pageBlockTable value="{!lstDupContact}" var="ct">
            <apex:column value="{!ct.id}"/>
            <apex:column value="{!ct.firstName}"/>
        	<apex:column value="{!ct.lastName}"/>
        </apex:pageBlockTable>
		
            
        </apex:pageBlock>
        
    </apex:form> 
    
</apex:page>
public class LeadConvertController{
    Lead lead;
    public List<Contact> lstDupContact {get; set;}
    
    public LeadConvertController(ApexPages.StandardController controller) {
		this.lead = (Lead)controller.getRecord();
	}
    
    public PageReference ConvertLead(){
        System.debug('Inside Lead Convert Controller');
        Database.LeadConvert lc = new database.LeadConvert();
        lc.setLeadId(lead.Id);
        Lead leadRecord = [SELECT firstName, lastName, email from lead where id =: lead.Id];
        System.debug('lead Owner >> ' + lead.OwnerId);
        //GroupMember grpMember = [Select UserOrGroupId from groupmember where groupid= :lead.OwnerId];
        //System.debug('GroupMember--->' + grpMember.UserOrGroupId);
        //lc.setOwnerId(grpMember.UserOrGroupId);
        lc.setConvertedStatus('Qualified'); 
       // Database.LeadConvertResult lcr = Database.convertLead(lc); 
        //if(lcr.isSuccess()){
          //  String aId = lcr.getAccountId();
            
            lstDupContact = [SELECT id, firstName, lastName, email from Contact where (firstName =: leadRecord.FirstName OR lastName =: leadRecord.LastName) AND email =: leadRecord.email];
            System.debug('lstDupContacts >>>' + lstDupContact);
           
            
            PageReference redirect = new PageReference('https://c.cs7.visual.force.com/apex/CustomLeadConvert?retURL=%2F00QM0000005IVfb&scontrolCaching=1&id=00QM0000005IVfb&id=' + lead.Id + '&sfdc.override=1');
            redirect.setRedirect(false);
            return redirect;
        //}
        return new PageReference('/'+'');
    }
    
    public List<Contact> getLstDupContact(){
        return lstDupContact;
    }
    
 
}


Hi,

I need to implement the following functionality:-

Once user selects products from ProductList, add 1 quantity of each with Today's Date to Product Related List and skip the screen for entering the same altogether. How can I Implement this functionality?

Thanks in Advance
I am trying to get a list of duplicate contacts on Lead Conversion. This is the trigger I have written so far.
trigger LeadConvert on Lead (after update) {
 
    if(trigger.new.size() > 1) 
            return;
     
    if (trigger.old[0].isConverted == false && trigger.new[0].isConverted == true) {
        
        //Block for deduping Contacts
        if (Trigger.new[0].ConvertedContactId != null) {
            System.debug('Converted ontact Id >>> ' + Trigger.new[0].ConvertedContactId);
            System.debug('trigger.old[0]>>>' +trigger.old[0]);
            System.debug('trigger.old[0]>>>' +trigger.new[0]);
            List<Contact> lstDupContact = [SELECT id, firstName, lastName, email from Contact where (firstName =: Trigger.new[0].FirstName OR
                                          lastName =: Trigger.new[0].LastName) AND email =: Trigger.new[0].email];
            
            
            
            for(Contact c: lstDupContact){
            
            
            System.debug('lstDupContact >>>>' + lstDupContact);
            Lead oldRec = Trigger.old[0];
                oldRec.Name.addError('Duplicate Contacts Found!!');
                //oldRec.addError('Duplicate Contacts Found!!');
            }
            
        }
       
        
    }
}
The lstDupContact now contains all duplicate contacts. How can I display this list to users? I tried displaying error message using oldRec.Name.addError('Duplicate Contacts Found!!'); but was unable to do so. 

Basically I want my duplicate contacts list to be displayed to users. Kindly suggest as it is urgent.

Thanks
In my current system, the Lead Convesrion requires my Sales Rep to Select only one account XYZ when the Compay name is not known. However, if the Company Name is known, a new Account will be created by the Sales Rep. The contact thet gets created will be created under the XYZ account. A relationship is mantained between the contact and newly created account. I require to:-

Show a list of all simialr Contacts. How can I implement this functionality?

I can write a trigger to fetch duplicate contacts. But how do I show this to user as a list from which user can select one? Can I use Visualforce page for displaying the contact list?

Thanks in Advance
I am writing a scheduler to run a batch process monthly on OpportunityLineItems and update the ServiceDate to Current Date. The query that I am usin to fetch OpportunityLineItems for Opportunities whose CloseDate > Today's date gives error.

Query:-
'SELECT servicedate, opportunityid from OpportunityLineItem where opportunityid IN \'(SELECT id from opportunity where closeDate >\')' + System.today().format();

Error:
00:00:22.058 (58548104)|EXCEPTION_THROWN|[11]|System.QueryException: expecting a colon, found '(SELECT id from opportunity where closeDate >'
00:00:22.058 (58619737)|SYSTEM_METHOD_EXIT|[11]|Database.getQueryLocator(String)
00:00:22.058 (58676089)|FATAL_ERROR|System.QueryException: expecting a colon, found '(SELECT id from opportunity where closeDate >'

How should I modify the query?

Thanks in Advance!
I have a requirement to update the Opportunity Product Date in the Opportunity producyt related list after a defined amount of time. Can I do this using a workflow rule or will I have to write some trigger? Also in case of trigger, how can I set the trigger to fire automatically after the said time period?
I have a particular Background process listed in the list of Background Jobs. I need to know the origin for the same. It is running twice everyday but not at fixed times. Can anyone guide me how to proceed?
I have a requirement to call a @future method from a Trigger. However, the method is not getting executed at all. None of my debug statements are getting printed. Can anyone give any pointers?
I need to implement Salesforce for a Retailer. How can I work to best meet the business needs? I know it is a very broad question. I need pointers to land in a correct position.

Thanks In Advance.
I have created a List JS button in Opportunity Page > Quote Related List to generate Quote PDF for the selected Quote record. I get PdfOverlay undefined and after that a message is displayed "Cannot read Property 'dialog' of undefined. Below is my code:-

{!REQUIRESCRIPT("/soap/ajax/14.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/14.0/apex.js")}

records = {!GETRECORDIDS($ObjectType.Quote)};
alert('records > ' + records);
var selectedRecords = [records];
alert('selectedRecords>' + selectedRecords);


var pdfOverlay = QuotePDFPreview.quotePDFObjs['quotePDFOverlay'];

alert('pdfOverlay > ' + pdfOverlay);

pdfOverlay.dialog.buttonContents = '<input value=\"Save to Quote\"  class=\"btn\" name=\"save\" onclick=\"QuotePDFPreview.getQuotePDFObject(\'quotePDFOverlay\').savePDF(\'0\',\'0\');\" title=\"Save to Quote\" type=\"button\" /><input value=\"Save and Email Quote\"  class=\"btn\" name=\"saveAndEmail\" onclick=\"QuotePDFPreview.getQuotePDFObject(\'quotePDFOverlay\').savePDF(\'1\');\" title=\"Save and Email Quote\" type=\"button\" /><input value=\"Cancel\"  class=\"btn\" name=\"cancel\" onclick=\"QuotePDFPreview.getQuotePDFObject(\'quotePDFOverlay\').close();\" title=\"Cancel\" type=\"button\" />';



 //change this to use the correct template for your business/environment!! 
pdfOverlay.summlid = '0EH90000000Gdtu'; 

 pdfOverlay.setSavable(true); 

 //change this to use the quote id 
pdfOverlay.setContents('/quote/quoteTemplateDataViewer.apexp?id={!Quote.Id}','quote/quoteTemplateHeaderData.apexp?id={!Quote.Id}'); 

 pdfOverlay.display();

Kindly suggest some soln.
 Ihave created workflow rules to assign leads to a Particular Owner's queue on lead creation. So, after the lead is created it will be assigned to the owner's queue. Now I have written a custom Lead Convert VisualForce page. But when I click on Convert button, it gives error:-

 ConvertLead failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Converted objects can only be owned by users. If the lead is not owned by a user, you must specify a user for the Owner field.: []
Error is in expression '{!ConvertLead}' in component <apex:commandButton> in page customleadconvert

This error comes as the lead is still assigned to the queue and conversion requires the lead to be assigned to owner. How can I automate the assignment back to User A if the lead is assigned to A's queue when my custom VF page loads? My VF Page is given below:
<apex:page standardController="Lead" extensions="LeadConvertController">
    <apex:includescript value="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" />
     <apex:sectionHeader title="Convert {!$ObjectType.Lead.label}" subtitle="{!Lead.name}"/>
    <apex:form >
        <apex:pageBlock mode="edit" >
       
        <apex:pageblockbuttons >
                <apex:commandbutton value="Convert" action="{!ConvertLead}"/>
                <apex:commandbutton value="Cancel" action="{!Cancel}"/>
        </apex:pageblockbuttons>
        
        <apex:pageblocksection id="LeadConvertPBS" title="Convert Lead">
         <apex:pageBlockSectionItem >
            <apex:outputLabel value=" Record Owner" for="Record Owner"/>
            <apex:inputField value="{!Lead.OwnerID}" id="recOwner"/>
          </apex:pageBlockSectionItem>
          <apex:pageBlockSectionItem >
            <apex:outputLabel for="Account Name">Account Name</apex:outputLabel>
             <apex:inputField required="true" id="company" value="{!Lead.Company}" />
          </apex:pageBlockSectionItem>
          <apex:pageBlockSectionItem >
           <apex:OutputLabel for="Send Email to the Owner">Send Email to the Owner</apex:OutputLabel>
           <apex:inputCheckbox onclick="{!Lead.Ownerid}"/>
           </apex:pageBlockSectionItem> 
          <apex:pageBlockSectionItem >
            <apex:outputLabel for="Oppt Name">Opportunity Name:</apex:outputLabel>
             <apex:inputField required="true" id="Owner" value="{!Lead.Company}" />
          </apex:pageBlockSectionItem>
          <apex:pageBlockSectionItem >
                      <apex:outputLabel for="ConStatus">Converted Status:</apex:outputLabel>
             <apex:inputField id="ConStatus" value="{!Lead.Status}" />
          </apex:pageBlockSectionItem>
          <apex:pageblockSectionItem >
              <apex:outputLabel for="no oppty">Do not create new opportunity upon conversion</apex:outputLabel>
               <apex:inputCheckbox id="noOppty"/>
               
          </apex:pageblockSectionItem>
        </apex:pageblocksection> 
  <apex:pageblocksection id="BookingPBS" title="Booking Details">
         <apex:pageblockSectionItem >
                <apex:outputLabel for="BookingStart">Booking Start Date/Time</apex:outputLabel>
         <apex:inputField id="BookingStart" value="{!lead.Booking_Start_Date_Time__c}"/>
            </apex:pageblockSectionItem>
            <apex:pageblockSectionItem >
                <apex:outputLabel for="BookingEnd">Booking End Date/Time</apex:outputLabel>
         <apex:inputField id="BookingEnd" value="{!lead.Booking_End_Date_Time__c}"/>
            </apex:pageblockSectionItem>
            <apex:pageblockSectionItem >
                <apex:outputLabel for="BookingOwner">Booking Owner</apex:outputLabel>
         <apex:inputField id="BookingOwner" value="{!lead.Booking_Owner__c}"/>
            </apex:pageblockSectionItem>
            </apex:pageblocksection>
            <apex:pageblocksection id="ServicePBS" title="Service Type">
            <apex:pageblockSectionItem >
                <apex:outputLabel for="ServiceFree30Min">Free 30 Minute Assessment</apex:outputLabel>
                <apex:inputCheckbox id="ServiceFree30Min" value="{!lead.Free_30_Minute_Assessment__c}"/>
            </apex:pageblockSectionItem>
            <apex:pageblockSectionItem >
                <apex:outputLabel for="ServicePutterFitting">Putter Fitting</apex:outputLabel>
                <apex:inputCheckbox id="ServicePutterFitting" value="{!lead.Putter_Fitting__c}"/>
            </apex:pageblockSectionItem>
            <apex:pageblockSectionItem >
                <apex:outputLabel for="ServiceWedgeFitting">Wedge Fitting</apex:outputLabel>
                <apex:inputCheckbox id="ServiceWedgeFitting" value="{!lead.Wedge_Fitting__c}"/>
            </apex:pageblockSectionItem>
            <apex:pageblockSectionItem >
                <apex:outputLabel for="ServiceIronFitting">Iron Fitting</apex:outputLabel>
                <apex:inputCheckbox id="ServiceIronFitting" value="{!lead.Iron_Fitting__c}"/>
            </apex:pageblockSectionItem>
            <apex:pageblockSectionItem >
                <apex:outputLabel for="ServiceDriverFitting">Driver Fitting</apex:outputLabel>
                <apex:inputCheckbox id="ServiceDriverFitting" value="{!lead.Driver_Fitting__c}"/>
            </apex:pageblockSectionItem>
            <apex:pageblockSectionItem >
                <apex:outputLabel for="ServiceWoodsHybridFitting">Woods + Hybrid Fitting</apex:outputLabel>
                <apex:inputCheckbox id="ServiceWoodsHybridFitting" value="{!lead.Woods_Hybrid_Fitting__c}"/>
            </apex:pageblockSectionItem>
            <apex:pageblockSectionItem >
                <apex:outputLabel for="ServiceTrackmanGolfLesson">Trackman Golf Lesson</apex:outputLabel>
                <apex:inputCheckbox id="ServiceTrackmanGolfLesson" value="{!lead.Trackman_Golf_Lesson__c}"/>
            </apex:pageblockSectionItem>
        </apex:pageblocksection>
        </apex:pageBlock>
        
    </apex:form> 

</apex:page>

 
I have a requirement wherein following needs to be implemented:-

For a particular Opportunity Record Type - 

If there are Opportunity Stages A, B, C, D, E, F Team1 should be able to progress the opp till stage C and also to stage F. They should not be able to progress opp to Stages D, E.

Team2 should be able to progress the opp to all stages.

How can I achieve this functionality? I thought of creating multiple Sales Process but this would require me to create multiple Record Types.
I need to implement the following scenario:-

All the cases which have been put on hold should be reassigned to a particular queue. I need this to run every 15 days. I am thinking of addressing this by creating a Time Dependent workflow that would be evaluated:-

1) When a record is created, and any time it’s edited to subsequently meet criteria.
2) Every15 days after Case: Last Modified Date.

Is this the correct way OR do I need to implement this programatically?

How can I take care of my existing cases which are created before the workflow is created?
I need to setup an Approval Process for discounts. The discount field is available on Opportunity Product. However while defining approval process, there is no option to select OpportunityProduct fields.

How can I setup the approval process?
I have a product Pageblock table. There are some input fields in the table and I need to set default values for these. How can I achieve this? Code is pasted below:-

<apex:column headerValue="{!$ObjectType.OpportunityLineItem.Fields.ServiceDate.Label}">
                        <apex:inputField value="{!s.ServiceDate}" required="false"/>
 </apex:column>

<apex:column headerValue="{!$ObjectType.OpportunityLineItem.Fields.Quantity.Label}">
                    	<apex:inputField value="{!s.Quantity}" style="width:70px" required="true" 
                    </apex:column>


I have made a custom LeadConvert page. I need to pass following values from the page to the controller. How can I achieve this?

Controller snippet:--

<apex:pageBlockSectionItem >
            <apex:outputLabel for="Subject">Subject</apex:outputLabel>
            <apex:inputField value="{!Task.Subject}" id='tskSubject' >
             	<apex:param value="{!Task.Subject}" assignTo="{!tskSubject}"/>
             </apex:inputField>
          </apex:pageBlockSectionItem>
          <apex:pageBlockSectionItem >
            <apex:outputLabel for="Type">Type</apex:outputLabel>
            <apex:inputField value="{!Task.Type}" id='tskType'/>
          </apex:pageBlockSectionItem>


I have created a changeset that contains only an edit to a URL name in a tab. I am getting errors deploying it in production for test classes which are not even in my changeset. Kindly help.
I have created a Custom Lead Convert Page. I need to show a list of duplicate contacts on Lead Conversion. I have been trying to do so using Apex:Repeat and Apex:PageBlockTable but nothing is getting displayed. My SOQL does return results. Kindly suggest. My Controller and Visualforce Page are given below:-

VisualForce Page:
<apex:page standardController="Lead" extensions="LeadConvertController">
    <apex:includescript value="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" />
     <apex:sectionHeader title="Convert {!$ObjectType.Lead.label}" subtitle="{!Lead.name}"/>
    <apex:form id="leadForm">
        <apex:pageBlock mode="edit" >
       
        <apex:pageblockbuttons >
                <apex:commandbutton value="Convert" action="{!ConvertLead}"/>
                <apex:commandbutton value="Cancel" action="{!Cancel}"/>
        </apex:pageblockbuttons>
        
        <apex:pageblocksection id="LeadConvertPBS" title="Convert Lead">
        	<apex:pageBlockSectionItem >
            <apex:outputLabel value=" Record Owner" for="Record Owner"/>
                <apex:inputField value="{!lead.OwnerID}" id="recOwner1" />
            
          	</apex:pageBlockSectionItem>
            
            <apex:pageBlockSectionItem >
            <apex:outputLabel for="Account Name">Account Name</apex:outputLabel>
             <apex:inputField required="true" id="company" value="{!lead.Company}" />
          </apex:pageBlockSectionItem>
          <apex:pageBlockSectionItem >
           <apex:OutputLabel for="Send Email to the Owner">Send Email to the Owner</apex:OutputLabel>
           <apex:inputCheckbox onclick="{!lead.Ownerid}"/>
           </apex:pageBlockSectionItem> 
          <apex:pageBlockSectionItem >
            <apex:outputLabel for="Oppt Name">Opportunity Name:</apex:outputLabel>
             <apex:inputField required="true" id="opptName" value="{!lead.Company}" />
          </apex:pageBlockSectionItem>
          <apex:pageBlockSectionItem >
                      <apex:outputLabel for="ConStatus">Converted Status:</apex:outputLabel>
             <apex:inputField id="ConStatus" value="{!lead.Status}" />
          </apex:pageBlockSectionItem>
          <apex:pageblockSectionItem >
             <!-- <apex:outputLabel for="no oppty">Do not create new opportunity upon conversion</apex:outputLabel>
              	<apex:inputCheckbox id="noOppty"/>-->
               
          </apex:pageblockSectionItem>
        </apex:pageblocksection> 
        <!--<apex:outputPanel id="contactList" layout="block">
        	<apex:pageBlockSection title="Contact List">
            </apex:pageBlockSection>
            <apex:repeat value="{!lstDupContact}">
				<apex:outputText value="{!lstDupContact}"></apex:outputText>            
            </apex:repeat>
        </apex:outputPanel>-->
        <apex:pageBlockTable value="{!lstDupContact}" var="ct">
            <apex:column value="{!ct.id}"/>
            <apex:column value="{!ct.firstName}"/>
        	<apex:column value="{!ct.lastName}"/>
        </apex:pageBlockTable>
		
            
        </apex:pageBlock>
        
    </apex:form> 
    
</apex:page>
public class LeadConvertController{
    Lead lead;
    public List<Contact> lstDupContact {get; set;}
    
    public LeadConvertController(ApexPages.StandardController controller) {
		this.lead = (Lead)controller.getRecord();
	}
    
    public PageReference ConvertLead(){
        System.debug('Inside Lead Convert Controller');
        Database.LeadConvert lc = new database.LeadConvert();
        lc.setLeadId(lead.Id);
        Lead leadRecord = [SELECT firstName, lastName, email from lead where id =: lead.Id];
        System.debug('lead Owner >> ' + lead.OwnerId);
        //GroupMember grpMember = [Select UserOrGroupId from groupmember where groupid= :lead.OwnerId];
        //System.debug('GroupMember--->' + grpMember.UserOrGroupId);
        //lc.setOwnerId(grpMember.UserOrGroupId);
        lc.setConvertedStatus('Qualified'); 
       // Database.LeadConvertResult lcr = Database.convertLead(lc); 
        //if(lcr.isSuccess()){
          //  String aId = lcr.getAccountId();
            
            lstDupContact = [SELECT id, firstName, lastName, email from Contact where (firstName =: leadRecord.FirstName OR lastName =: leadRecord.LastName) AND email =: leadRecord.email];
            System.debug('lstDupContacts >>>' + lstDupContact);
           
            
            PageReference redirect = new PageReference('https://c.cs7.visual.force.com/apex/CustomLeadConvert?retURL=%2F00QM0000005IVfb&scontrolCaching=1&id=00QM0000005IVfb&id=' + lead.Id + '&sfdc.override=1');
            redirect.setRedirect(false);
            return redirect;
        //}
        return new PageReference('/'+'');
    }
    
    public List<Contact> getLstDupContact(){
        return lstDupContact;
    }
    
 
}


Hi,

I need to implement the following functionality:-

Once user selects products from ProductList, add 1 quantity of each with Today's Date to Product Related List and skip the screen for entering the same altogether. How can I Implement this functionality?

Thanks in Advance
I am trying to get a list of duplicate contacts on Lead Conversion. This is the trigger I have written so far.
trigger LeadConvert on Lead (after update) {
 
    if(trigger.new.size() > 1) 
            return;
     
    if (trigger.old[0].isConverted == false && trigger.new[0].isConverted == true) {
        
        //Block for deduping Contacts
        if (Trigger.new[0].ConvertedContactId != null) {
            System.debug('Converted ontact Id >>> ' + Trigger.new[0].ConvertedContactId);
            System.debug('trigger.old[0]>>>' +trigger.old[0]);
            System.debug('trigger.old[0]>>>' +trigger.new[0]);
            List<Contact> lstDupContact = [SELECT id, firstName, lastName, email from Contact where (firstName =: Trigger.new[0].FirstName OR
                                          lastName =: Trigger.new[0].LastName) AND email =: Trigger.new[0].email];
            
            
            
            for(Contact c: lstDupContact){
            
            
            System.debug('lstDupContact >>>>' + lstDupContact);
            Lead oldRec = Trigger.old[0];
                oldRec.Name.addError('Duplicate Contacts Found!!');
                //oldRec.addError('Duplicate Contacts Found!!');
            }
            
        }
       
        
    }
}
The lstDupContact now contains all duplicate contacts. How can I display this list to users? I tried displaying error message using oldRec.Name.addError('Duplicate Contacts Found!!'); but was unable to do so. 

Basically I want my duplicate contacts list to be displayed to users. Kindly suggest as it is urgent.

Thanks
In my current system, the Lead Convesrion requires my Sales Rep to Select only one account XYZ when the Compay name is not known. However, if the Company Name is known, a new Account will be created by the Sales Rep. The contact thet gets created will be created under the XYZ account. A relationship is mantained between the contact and newly created account. I require to:-

Show a list of all simialr Contacts. How can I implement this functionality?

I can write a trigger to fetch duplicate contacts. But how do I show this to user as a list from which user can select one? Can I use Visualforce page for displaying the contact list?

Thanks in Advance
I am writing a scheduler to run a batch process monthly on OpportunityLineItems and update the ServiceDate to Current Date. The query that I am usin to fetch OpportunityLineItems for Opportunities whose CloseDate > Today's date gives error.

Query:-
'SELECT servicedate, opportunityid from OpportunityLineItem where opportunityid IN \'(SELECT id from opportunity where closeDate >\')' + System.today().format();

Error:
00:00:22.058 (58548104)|EXCEPTION_THROWN|[11]|System.QueryException: expecting a colon, found '(SELECT id from opportunity where closeDate >'
00:00:22.058 (58619737)|SYSTEM_METHOD_EXIT|[11]|Database.getQueryLocator(String)
00:00:22.058 (58676089)|FATAL_ERROR|System.QueryException: expecting a colon, found '(SELECT id from opportunity where closeDate >'

How should I modify the query?

Thanks in Advance!
I have a requirement to update the Opportunity Product Date in the Opportunity producyt related list after a defined amount of time. Can I do this using a workflow rule or will I have to write some trigger? Also in case of trigger, how can I set the trigger to fire automatically after the said time period?
Here is my VF page for lead conversion. not able to figure out what else needs in my test class to increase the coverage. PLease help.

<apex:page standardController="Lead" extensions="XXCSRLeadConvertClass"   title="Convert Lead" id="pgConvertLead">

<apex:form id="frmConvert">

    <apex:actionFunction name="afOpportunity" action="{!doNothing}" rerender="pbsConvert" immediate="true" />

    <apex:pageBlock title="Convert Lead" mode="edit">
   
        <apex:pageBlockButtons >
            <apex:commandButton id="cmdConvert" action="{!convertLead}" value="Convert" />
            <apex:commandButton id="cmdCancel" action="{!cancel}" value="Cancel" />
        </apex:pageBlockButtons>
       
        <apex:messages ></apex:messages>
       
        <apex:pageBlockSection id="pbsConvert" title="Convert Lead" columns="1">
                       
            <apex:inputField id="ifOwnerId" value="{!ldSource.OwnerId}" />
            <apex:selectList id="soAccount" value="{!strAccountId}" label="Account Name" size="1">
                <apex:selectOptions value="{!lstCompanyInfo}" />
            </apex:selectList>
            <apex:selectList id="soContact" value="{!strContactId}" label="Contact Name" size="1">
                <apex:selectOptions value="{!lstContactInfo}" />
            </apex:selectList>
                      
        </apex:pageBlockSection>
   
    </apex:pageBlock>

</apex:form>

</apex:page>

Here is extension class

public class XXCSRLeadConvertClass {
public Lead ldSource {get;set;}
public Boolean bolCreateOpp {get;set;}
public String strAccountId {get;set;}
public String strContactId {get;set;}



//////////////////////////
// Constructors / GETers
//////////////////////////
public XXCSRLeadConvertClass(ApexPages.StandardController scMain) {



ldSource = [SELECT Id, FirstName, LastName, OwnerId, Company, Street, City, State, PostalCOde, Country, Phone, Fax,Status,ApprovalStatus__c FROM Lead WHERE Id = :scMain.getId()];
bolCreateOpp = false;

    
}

public List<SelectOption> getlstCompanyInfo() {

String strCompanyWildcard = '%' + ldSource.Company + '%';
List<Account> lstAcct = [SELECT Id, Name, Owner.Name FROM Account WHERE Name LIKE :strCompanyWildcard];

List<SelectOption> lstCompanies = new List<SelectOption>();

// Add New Account if not found
lstCompanies.add(new SelectOption('1','Create New Account: ' + ldSource.Company));

// Add found Accounts to SelectList
for(Account a : lstAcct) {
lstCompanies.add(new SelectOption(a.Id, 'Attach to Existing: ' + a.Name + ' (' + a.Owner.Name + ')'));
}

return lstCompanies;      
}

    public List<SelectOption> getlstContactInfo(){
       
       string strContactFirst = '%'+ldSource.FirstName+'%';
        string strContactLast = '%'+ldSource.LastName+'%';
        List<Contact> lsContact = [select Id ,FirstName,LastName,AccountId,Owner.Name from Contact where (FirstName like : strContactFirst and LastName like :strContactLast)
                                   and AccountId = :[select Id from Account where Name like :ldSource.Company]];
       List<SelectOption> lstContact = new List<SelectOption>();
       
        // Add New Contact if not found
lstContact.add(new SelectOption('1','Create New Contact: ' + ldSource.FirstName+''+ldSource.LastName));

// Add found Accounts to SelectList
for(Contact c : lsContact) {
lstContact.add(new SelectOption(c.Id, 'Attach to Existing: ' + c.FirstName +' '+c.LastName+ ' (' + c.Owner.Name + ')'));
    }
return lstContact;         
    }
//////////////////////////
// Action Methods
//////////////////////////

public void doNothing() {  }

public PageReference convertLead() {

//check if status = qualified and Approved
if (ldSource.Status == 'Qualified' && ldSource.ApprovalStatus__c == 'Approved'){


// Create LeadConvert object
Database.LeadConvert lc = new Database.LeadConvert();

        
lc.setLeadId(ldSource.Id);
lc.setOwnerId(ldSource.OwnerId);
if(strAccountId.length() > 1) { lc.setAccountId(strAccountId); }
if(strContactId.length() > 1) { lc.setContactId(strContactId); }
lc.setDoNotCreateOpportunity(bolCreateOpp);

// Set Opportunity Name
if(bolCreateOpp == true) { lc.setOpportunityName(ldSource.Company); }

// Set Lead Converted Status
LeadStatus convertStatus = [SELECT Id, MasterLabel FROM LeadStatus WHERE IsConverted=true LIMIT 1];
lc.setConvertedStatus(convertStatus.MasterLabel);



// Convert!
Database.LeadConvertResult lcr = Database.convertLead(lc);

// Mop up Opportunity
if(bolCreateOpp == true) {
Opportunity o = new Opportunity(Id=lcr.getOpportunityId());
update o;
}
// Redirect...
PageReference prResult;
if(lcr.isSuccess()) {
prResult = new PageReference('/' + lcr.getAccountId());
prResult.setRedirect(true);
return prResult;  
} else {
return null;
}
}else{
ldSource.addError('Lead cannot be converted without Lead status Qualified and Approved !'); 
      ldSource.addError('Please Go back to Lead screen to change status'); 
    }
   
return null;}
}


Here is my test code

@IsTest(seealldata=true)
private class TestXXCSRLeadConvertClass{

        static testMethod void TestXXCSRLeadConvertClass() {
      
       test.startTest();
           Boolean bolCreateOpp;
           String strAccountId;
     String strContactId;
            Lead l = new Lead();
            l.FirstName = 'CRM Testing First';
            l.LastName = 'CRM Testing Last';
            l.Company = 'CRM Testing INCtest';
            l.description = 'Test descr';
            l.city = 'test';
            l.street = 'test';
            l.state = 'CA';
            l.country = 'United States';
            l.status = 'Qualified';
            l.email = 'test@testnetgear.com';
            l.website = 'www.testcrm.com';
            l.ApprovalStatus__c='Approved';
            l.RecordTypeId='012110000004b9Q';
             
        
            insert l;
       
      Id leadId = l.Id;
  bolCreateOpp = false;
  //Create a reference to the VF page
  PageReference pageRef = Page.XXCSR_LEAD_CONVERT;
        Test.setCurrentPageReference(pageRef);

     //Create an instance of the controller extension and call the autoRun method.
  //autoRun must be called explicitly even though it is "autoRun".
  ApexPages.StandardController sc = new ApexPages.standardController(l);
  XXCSRLeadConvertClass leadconvt = new XXCSRLeadConvertClass(sc);
   String nextPage = sc.save().getUrl();
 
      
       List<SelectOption> testacct = new List<SelectOption>();
       testacct = leadconvt.getlstCompanyInfo();
        system.debug(testacct);
    
       
  List<SelectOption> testcon = new List<SelectOption>();
       testcon = leadconvt.getlstContactInfo();
        system.debug(testcon);
 
   leadconvt.doNothing();
 
             //Retrieve the converted Lead info and the opps and roles.
   l = [select Id, IsConverted, ConvertedAccountId, ConvertedContactId ,Status, ApprovalStatus__c,
    Company,OwnerId,firstname,lastname,city,country from Lead where Id = :leadId];
         
          system.assert(!l.IsConverted,'Lead Converted' ); 
          test.stopTest();
        


        }
  
        

}

Thanks
Pallavi
I need to implement Salesforce for a Retailer. How can I work to best meet the business needs? I know it is a very broad question. I need pointers to land in a correct position.

Thanks In Advance.
I have created a JavaScript Button to Create quotes automatically. Now I am trying to generate the PDF for the same automatically. My requirement is:-

1) Generate and attach the Quote PDF automatically.
2) Once the PDF is generated, email the Quote PDF automatically to the customer.

For 1: I am writing a visualforce page for generating Quote PDF. The PDF is getting generated but the data related to quote like QuoteNumber is not getting rendered.:-

<apex:page standardController="Quote" showHeader="false" renderAs="pdf" applyhtmltag="false" >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<style type="text/css">
body {
    font-family: sans-serif;
    font-size:12px;
}
table.imagetable {
    width:100%;
    font-family: sans-serif;
    font-size:12px;
    color:#333333;
    border-width: 1px;
    border-color: #999999;
    border-collapse: collapse;
}

table.imagetable th {
    background:#C0D5D8;
    border-width: 1px;
    padding: 8px;
    border-style: solid;
    border-color: #999999;
}

table.imagetable td {
    background:#EFEFEF;
    border-width: 1px;
    padding: 8px;
    border-style: solid;
    border-color: #999999;
}

table.sectionHeadings {
    font-family: sans-serif;
    font-size:16px;
    color:#1E4481;
    border-width: .5px;
    border-color: #999999;
    border-collapse: collapse;
}

table.sectionHeadings th{
    padding: 15px;
    border-top-style:solid;
    border-top-color:#1E4481;
    border-bottom-style:solid;
    border-bottom-color:#1E4481;
    width: 690px;
}

table.headingTopLine th{
    font-family: sans-serif;
    font-size:16px;
    color:#1E4481;
    padding: 15px;
    border-top-style:solid;
    border-top-color:#1E4481;
    width: 690px;
}
table.headingBottomLine td{
    font-family: sans-serif;
    font-size:16px;
    color:#1E4481;
    padding: 15px;
    border-bottom-style:solid;
    border-bottom-color:#1E4481;
    width: 40px;
}

</style>
</head>    
<body> 
     <!--<apex:form >
     <apex:actionFunction name="savePDF" action="{!savePDF}" />
     </apex:form>-->  
     <apex:panelGrid columns="3" width="100%" style="font-size: 12px; font-family: sans-serif">
        <!-- <apex:image url="<a target="_blank" href="https://c.cs14.content.force.com/servlet/servlet.ImageServer?oid=00Dc0000001LPXH&id=015c000000075xm"">https://c.cs14.content.force.com/servlet/servlet.ImageServer?oid=00Dc0000001LPXH&id=015c000000075xm"</a> width="208" height="79" /> -->   
         <apex:panelGroup layout="block" >
             <apex:outputText value="{!$Organization.Name}" /><br></br>
             <apex:outputText value="{!$Organization.Street}"/><br></br>
             <apex:outputText value="{!$Organization.City}, {!$Organization.State} {!$Organization.PostalCode}"/><br></br>
             <apex:outputText value="{!$Organization.Phone}"/>
         </apex:panelGroup>
         <apex:panelGroup layout="block" >             
             <apex:outputText value="Created Date: {!TODAY()} "/><br></br>             
             <!--<apex:outputText value="Offer Expires: {!Quote.ExpirationDate}"/><br></br>-->
             <apex:outputText value="Quote Number: {!Quote.QuoteNumber}"/><br></br>
             <!--<apex:outputText value="Reference: {!Quote.Opportunity}"/>-->
         </apex:panelGroup>
     </apex:panelGrid>
     <br> </br>
     
     <!-- Order Schedule Section Heading  -->
     
     <table Class="sectionHeadings" >
         <tr>
         <th>Order Schedule<br> </br></th>
         </tr>         
     </table>
     <br> </br>
     
     <!-- Prepared for Bill To Section -->
     
     <table  width="100%" >
         <tr >
         <th><apex:outputText value="Prepared for" /></th>         
         <th><apex:outputText value="Bill to" /></th>        
         </tr>       
         <tr>             
         <td><apex:outputText value="Name    : {!Quote.Contact.FirstName} {!Quote.Contact.LastName}" /></td>             
         <td><apex:outputText value="Name  : {!Quote.Opportunity.Name}"></apex:outputText></td>
         <!--<td><apex:outputText value="Name    : {!Quote.BillingName}" /></td>-->
         </tr>
         <!--<tr>             
         <td><apex:outputText value="Company    : {!Quote.Opportunity.Account.Name}" /></td>             
         <td><apex:outputText value="Company    : {!Quote.Opportunity.Account.Name}" /></td>
         </tr>-->
         <tr>             
         <td><apex:outputText value="Address : {!Quote.Contact.MailingStreet}" /></td>             
         <td><apex:outputText value="Address : {!Quote.BillingStreet}" /></td>
         </tr>
         <tr>             
         <td><apex:outputText value="  {!Quote.Contact.MailingCity}, {!Quote.Contact.MailingState} {!Quote.Contact.MailingPostalCode}" style="margin-left:55px" /></td>             
         <td><apex:outputText value="  {!Quote.BillingCity}, {!Quote.BillingState} {!Quote.BillingPostalCode}" style="margin-left:55px" /></td>
         </tr>
         <tr>             
         <td><apex:outputText value="Phone : {!Quote.Contact.Phone}" /></td>             
         <td><apex:outputText value="Phone : {!Quote.Opportunity.Account.Phone}" /></td>
         </tr>
         <tr>             
         <td><apex:outputText value="Email : {!Quote.Contact.Email}" /></td>             
         <td><apex:outputText value="Email : {!Quote.Contact.Email}" /></td>
         </tr>                    
     </table>
     <br> </br>
     
     <!-- Terms Section  -->
     
         <table class="headingTopLine">
         <tr>
         <th > Terms </th>
         </tr>
         <!--<tr>
                      
         <td><apex:outputText value="{!Quote.Billing_Terms__c}" style="font-weight:bold" /></td>                     
         </tr> 
         <tr>         
         <td><apex:outputText value="Payment terms    " style="font-weight:bold" rendered="{!IF((Quote.Billing_Terms__c="Fixed Fee Upfront"),true,false)}" escape="false" /> 
         <apex:outputText value=": Professional fees are due 100% upon the Effective Date.  All invoices are due upon receipt." rendered="{!IF((Quote.Billing_Terms__c="Fixed Fee Upfront"),true,false)}" escape="false" style="margin-left:10px" />          
         </td>
         </tr>
         <tr>
         <td><apex:outputText value="Payment method  " style="font-weight:bold" rendered="{!IF((Quote.Billing_Terms__c="Fixed Fee Upfront"),true,false)}" escape="false" /> 
         <apex:outputText value="   : Standard Invoicing - This option is available only for annual billing. You will be invoiced per the agreed upon payment terms as outlined on this Order Schedule." rendered="{!IF((Quote.Billing_Terms__c="Fixed Fee Upfront"),true,false)}" escape="false"  />          
         </td>         
         </tr>
         <tr>
         <td><apex:outputText value="Payment terms  " style="font-weight:bold" rendered="{!IF((Quote.Billing_Terms__c="Fixed Fee Milestone Project Based"),true,false)}" escape="false"/> 
         <apex:outputText value="   : Professional fees are due …  .All invoices are due upon receipt." rendered="{!IF((Quote.Billing_Terms__c="Fixed Fee Milestone Project Based"),true,false)}" escape="false" style="margin-left:10px"/>          
         </td>
         </tr>
         <tr>
         <td><apex:outputText value="Payment method  " style="font-weight:bold" rendered="{!IF((Quote.Billing_Terms__c="Fixed Fee Milestone Project Based"),true,false)}" escape="false" /> 
         <apex:outputText value="   : To be completed" rendered="{!IF((Quote.Billing_Terms__c="Fixed Fee Milestone Project Based"),true,false)}" escape="false" />          
         </td>         
         </tr>
         <tr>
         <td><apex:outputText value="Payment terms  " style="font-weight:bold" rendered="{!IF((Quote.Billing_Terms__c="Time And Materials"),true,false)}" escape="false" /> 
         <apex:outputText value="   : To be completed" rendered="{!IF((Quote.Billing_Terms__c="Time And Materials"),true,false)}" escape="false"  style="margin-left:10px"/>          
         </td>         
         </tr>
         <tr>
         <td><apex:outputText value="Payment method  " style="font-weight:bold" rendered="{!IF((Quote.Billing_Terms__c="Time And Materials"),true,false)}" escape="false" /> 
         <apex:outputText value="   : To be completed" rendered="{!IF((Quote.Billing_Terms__c="Time And Materials"),true,false)}" escape="false" />          
         </td>         
         </tr>-->
         </table>
         <br> </br>  
         
               
     <!-- Start of Quote Line Items *****
     ****                           *****
     ****                           **-->
     <div style="page-break-after:always;">  
     <table class="headingTopLine">
         <tr>
         <th > Product - Consulting </th>
         </tr>
     </table>
          <table class="imagetable">
         <tr>
         <th><apex:outputText value="{!$ObjectType.Product2.Fields.ProductCode.Label}" /></th>
         <th><apex:outputText value="Product" /></th>
         <th><apex:outputText value="Qty" /></th>
         <th><apex:outputText value="List" /></th>
         <th><apex:outputText value="Discount" /></th>
         <th><apex:outputText value="Sale Price" /></th>
         <th><apex:outputText value="Total Price" /></th>
         </tr>
         <!--<apex:repeat value="{!consultingLineItems}" var="line"  >-->         
         <!--<tr>
             
             <td><apex:outputField value="{!line.Product_CodeF__c}" /></td>
             <td><apex:outputField value="{!line.Product_NameF__c}" /></td>
             <td><apex:outputField value="{!line.Quantity}" /></td>
             <td><apex:outputField value="{!line.ListPrice}" /></td>
             <td><apex:outputField value="{!line.Discount}" /></td>
             <td><apex:outputField value="{!line.UnitPrice}" /></td>
             <td><apex:outputField value="{!line.TotalPrice}" /></td>
              
         </tr>-->
         <!--</apex:repeat>-->             
     </table>
      <apex:outputPanel layout="block" />
          <apex:panelGrid columns="2" columnClasses="right" width="100%">
              <apex:panelGrid columns="2" cellpadding="10" columnClasses="right totalLabel,right total" width="100%">
                  <apex:outputText value="Total"/>
                  <!--<apex:outputText value="{!consultingTotal}"/>-->
              </apex:panelGrid>
          </apex:panelGrid>
          
      <table class="headingTopLine">
      <tr>
      <th >  </th>
      </tr>
      </table>
      </div>
      <apex:outputPanel layout="block" styleClass="line"/>
      
          <table class="headingTopLine">      
         <tr>
         <th >  </th>
         </tr>
         <tr>
         <td>This Order Schedule is submitted pursuant to the Software as a Service Provider Agreement (the “Agreement”) an something else? 
         </td>
         </tr>
         <br></br>
         <tr>
         <td>Prices shown above do not include any taxes that may apply. 
         </td>
         <br></br>
         </tr>
         <tr>
         <td style="font-weight:bold" >IN WITNESS WHEREOF, the parties hereto have caused this Order Schedule and related Agreement to be executed by their duly authorized officers or representatives as of the Effective Date, by signature below.         </td>
         </tr>
         <br> </br>
         <br> </br>
    </table>
    <br> </br>
    <!-- Signatures -->
         <table style="padding:10px" width="100%"  >
         <tr >
         <th><apex:outputText value="{!Quote.Opportunity.Account.Name} " /></th> 
          
               
         <th><apex:outputText value="Kyriba Corporation " /></th> 
         <th></th>                
         </tr>
         <br> </br>
     
         <tr>
         <td >Authorized signature</td>
         <td style="border-bottom-style:solid; border-bottom-color:black;width:150px"></td>
         <td style="border-bottom-style:clear;width:40px"> </td>
         <td >Authorized signature</td>
         <td style="border-bottom-style:solid; border-bottom-color:black;width: 170px"></td>                   
         </tr>
         <br></br>
         <br></br>
         <tr>
         <td >Print Name and Title</td>
         <td style="border-bottom-style:solid; border-bottom-color:black;width:150px"></td>
         <td style="border-bottom-style:clear;width:40px"> </td>
         <td>Print Name and Title</td>
         <td style="border-bottom-style:solid; border-bottom-color:black;width: 170px"></td>                   
         </tr>
         <br></br>
         <br></br>
         <tr>
         <td >Signature date</td>
         <td style="border-bottom-style:clear;width:25px"></td>
         <td style="border-bottom-style:solid; border-bottom-color:black;width:150px"></td>
         <td style="border-bottom-style:clear;width:40px"> </td>
         <td>Signature date</td>         
         <td style="border-bottom-style:clear;width:28px"> </td>
         <td style="border-bottom-style:solid; border-bottom-color:black;width: 170px"></td>                   
         </tr>
         <br></br>
         <br></br>
         </table>
</body>
</html>      
  </apex:page>
For 2: What are the ways for implementing the 2nd requirement?