<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments for Jeff Douglas - Technology, Coding and Bears... OH MY!</title>
	<atom:link href="http://blog.jeffdouglas.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jeffdouglas.com</link>
	<description>Get your head out of your #@! and into the clouds!</description>
	<lastBuildDate>Wed, 08 Feb 2012 07:57:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>Comment on How to deploy Apex without test coverage by Anoop</title>
		<link>http://blog.jeffdouglas.com/2009/03/04/how-to-deploy-apex-without-test-coverage/comment-page-1/#comment-8064</link>
		<dc:creator>Anoop</dc:creator>
		<pubDate>Wed, 08 Feb 2012 07:57:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=495#comment-8064</guid>
		<description>Hi,
Is there any method of deploying in production instance without executing test methods, Yesterday When I deployed using Eclipse, it deployed to my production instance in minutes and did not executed any test class ( Usually it takes 2 hrs to run all test class).</description>
		<content:encoded><![CDATA[<p>Hi,<br />
Is there any method of deploying in production instance without executing test methods, Yesterday When I deployed using Eclipse, it deployed to my production instance in minutes and did not executed any test class ( Usually it takes 2 hrs to run all test class).</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Uploading a Document using Visualforce and a Custom Controller by Kirill</title>
		<link>http://blog.jeffdouglas.com/2010/04/22/uploading-a-document-using-visualforce-and-a-custom-controller/comment-page-1/#comment-8037</link>
		<dc:creator>Kirill</dc:creator>
		<pubDate>Fri, 03 Feb 2012 22:02:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=2461#comment-8037</guid>
		<description>Thanks for the tip about the &quot;finally&quot; keyword.   I was nulling out file bodies in other spots before the &quot;return&quot; statement, but kept running into the ViewState error.   Putting it into the &quot;finally&quot; block cleared it right up!</description>
		<content:encoded><![CDATA[<p>Thanks for the tip about the &#8220;finally&#8221; keyword.   I was nulling out file bodies in other spots before the &#8220;return&#8221; statement, but kept running into the ViewState error.   Putting it into the &#8220;finally&#8221; block cleared it right up!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Deploying Salesforce.com Metadata with ANT (Video) by Jeff Douglas</title>
		<link>http://blog.jeffdouglas.com/2011/05/19/deploying-salesforce-com-metadata-with-ant-video/comment-page-1/#comment-8033</link>
		<dc:creator>Jeff Douglas</dc:creator>
		<pubDate>Fri, 03 Feb 2012 16:13:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=3900#comment-8033</guid>
		<description>Sure! Take a look at: http://ant.apache.org/manual/listeners.html</description>
		<content:encoded><![CDATA[<p>Sure! Take a look at: <a href="http://ant.apache.org/manual/listeners.html" rel="nofollow">http://ant.apache.org/manual/listeners.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Deploying Salesforce.com Metadata with ANT (Video) by Anoop</title>
		<link>http://blog.jeffdouglas.com/2011/05/19/deploying-salesforce-com-metadata-with-ant-video/comment-page-1/#comment-8029</link>
		<dc:creator>Anoop</dc:creator>
		<pubDate>Fri, 03 Feb 2012 15:03:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=3900#comment-8029</guid>
		<description>Great demo Jeff,

I have question, is there any way to create log files instead of writing the output into a console ? that will be helpful for failed validation and builds</description>
		<content:encoded><![CDATA[<p>Great demo Jeff,</p>
<p>I have question, is there any way to create log files instead of writing the output into a console ? that will be helpful for failed validation and builds</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Apex Test Coverage Does Not Match? by Wes</title>
		<link>http://blog.jeffdouglas.com/2011/11/22/apex-test-coverage-does-not-match/comment-page-1/#comment-7552</link>
		<dc:creator>Wes</dc:creator>
		<pubDate>Fri, 23 Dec 2011 10:43:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=4294#comment-7552</guid>
		<description>Great minds thinks alike :) http://th3silverlining.com/2011/11/30/salesforce-different-percentage-code-coverage-in-different-environments/</description>
		<content:encoded><![CDATA[<p>Great minds thinks alike <img src='http://blog.jeffdouglas.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  <a href="http://th3silverlining.com/2011/11/30/salesforce-different-percentage-code-coverage-in-different-environments/" rel="nofollow">http://th3silverlining.com/2011/11/30/salesforce-different-percentage-code-coverage-in-different-environments/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Neat Salesforce URLFOR Trick by Alex</title>
		<link>http://blog.jeffdouglas.com/2010/12/28/neat-salesforce-urlfor-trick/comment-page-1/#comment-7546</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Thu, 22 Dec 2011 11:18:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=3392#comment-7546</guid>
		<description>sorry again the error is on the page tag which is definately the outermost but eventually Eclipse returns the error.</description>
		<content:encoded><![CDATA[<p>sorry again the error is on the page tag which is definately the outermost but eventually Eclipse returns the error.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Neat Salesforce URLFOR Trick by Alex</title>
		<link>http://blog.jeffdouglas.com/2010/12/28/neat-salesforce-urlfor-trick/comment-page-1/#comment-7544</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Wed, 21 Dec 2011 08:53:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=3392#comment-7544</guid>
		<description>sorry 

Save error:  is required and must be the outermost tag in the markup at line 1 column 1</description>
		<content:encoded><![CDATA[<p>sorry </p>
<p>Save error:  is required and must be the outermost tag in the markup at line 1 column 1</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Neat Salesforce URLFOR Trick by Alex</title>
		<link>http://blog.jeffdouglas.com/2010/12/28/neat-salesforce-urlfor-trick/comment-page-1/#comment-7543</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Wed, 21 Dec 2011 08:28:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=3392#comment-7543</guid>
		<description>Hi,  this is definately most usefull, I&#039;m trying to save the Visualforce page in my sandbox but get this error :

Save error:  is required and must be the outermost tag in the markup at line 1 column 1</description>
		<content:encoded><![CDATA[<p>Hi,  this is definately most usefull, I&#8217;m trying to save the Visualforce page in my sandbox but get this error :</p>
<p>Save error:  is required and must be the outermost tag in the markup at line 1 column 1</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Apex &#8220;Deep Clone&#8221; Controller by Bharthi Ramsewak</title>
		<link>http://blog.jeffdouglas.com/2009/11/19/apex-deep-clone-controller/comment-page-1/#comment-7498</link>
		<dc:creator>Bharthi Ramsewak</dc:creator>
		<pubDate>Mon, 12 Dec 2011 12:15:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=1710#comment-7498</guid>
		<description>Hi Jeff,

I have utilized your deep clone functionality to fit our organizations needs. 

Basically we have the following scenario :

We have a Quote Request, which has Vehicle Models related to it and you have accesories related to the models.

Below is the code we are using. The issue we are facing is if a quote has more than one Model it fails with the error :
Record ID: cannot specify Id in an insert call

The Code works if there is 1 model with 1 or more accessories attached to it. The issue comes in when there is 2 or more vehicle models attached to a quote. 

Is there any solution to the above issue we are facing?

===============================================
public class QuotationRequestCloneWithItemsController {

    //added an instance varaible for the standard controller
    private ApexPages.StandardController controller {get; set;}
     
    // add the instance for the variables being passed by id on the url
    private Quotation_Request__c qReq {get;set;}
    
    // set the id of the record that is created -- ONLY USED BY THE TEST CLASS
    public ID newRecordId {get;set;}

    // initialize the controller
    public QuotationRequestCloneWithItemsController(ApexPages.StandardController controller) {

        //initialize the stanrdard controller
        this.controller = controller;
        
        // load the current record
        qReq = (Quotation_Request__c)controller.getRecord();

    }

    // method called from the VF&#039;s action attribute to clone the Quote request
    public PageReference cloneWithItems() {

         // setup the save point for rollback
         Savepoint sp = Database.setSavepoint();
         Quotation_Request__c newqReq;

         try {

                              //copy the quote request - ONLY INCLUDE THE FIELDS YOU WANT TO CLONE
                             qReq = [select Account__c, 
                                     Arrears_Deal__c, 
                                     Call_Report__c, 
                                     Call_Report_Vehicle__c, 
                                     Canopies_Comments__c, 
                                     Canopies_Door__c, 
                                     Canopies_Material__c, 
                                     Canopies_Sliding_Windows__c, 
                                     Canopies_Windows__c, 
                                     Checked__c, 
                                     Contact_Person__c, 
                                     Customer__c, 
                                     Customer_Nominated_Accessory_Supplier__c, 
                                     Customer_Nominated_Supplier__c, 
                                     Date__c, 
                                     Deposit_Ex_VAT__c, 
                                     FAM__c, 
                                     Fuel_Cards__c, 
                                     Insurance__c, 
                                     Interest_Rate__c, 
                                     Lead__c, 
                                     License__c, 
                                     Medical_Aid_Kit__c, 
                                     Nominated_Residual__c, 
                                     Personalised_Number_Plates__c, 
                                     Product__c, 
                                     Prospects__c, 
                                     Quotation_Pricing_Method__c, 
                                     Name, 
                                     RV__c,
                                     ID, 
                                     Registered_Driver_Proxy__c, 
                                     Supplier_Name_Accessory__c, 
                                     Supplier_Name__c, 
                                     System_Parameters__c, 
                                     Tracking_Unit__c, 
                                     Tracking_Unit_Installation__c, 
                                     Tracking_Unit_Subscription__c, 
                                     Value_Add_Comment__c 
                                     from Quotation_Request__c where id = :qReq.id];
                             newqReq = qReq.clone(false);
                             insert newqReq;
                
                             //set the id of the new Quote Request to be inserted
                             newRecordId = newqReq.id;
                            
                                            
                           // copy over the models - ONLY INCLUDE THE FIELDS YOU WANT TO CLONE -- 
                            List Models = new List();
                            List ModelAccessory = new List();
                            
                            for (Quote_Model__c qm : [Select Models__c,
                            name,
                            make_description__c,
                            X1_Contract_Months__c,
                            X1_KM__c,
                            X2_Contract_Months__c,
                            X2_KM__c,
                            X3_Contract_Months__c,
                            X3_KM__c,
                            X4_Contract_Months__c,
                            X4_KM__c,No_of_Units__c,
                            m_m_number__c,
                            Required_Delivery_Date__c,
                            Delivery_Province__c,
                            Availability__c,
                            Required_Delivery_Area__c,
                            Comments__c,
                            Discontinued_Date__c,
                            Barred_Date__c
                            from Quote_Model__c  
                            where Quotation_Request__c = :qReq.id]) 
                                                                                                  
                                  {                                    
                                    Quote_Model__c newQM = qm.clone(false);
                                    newQM.Quotation_Request__c = newqReq.id;
                                    Models.add(newQM);
                                    insert Models;                                    
                
                                    //get accessories per model
                                    for (Accessory__c qmAcc : [SELECT Accessory_Number__c,
                                                               Canopies_Comments__c,Canopies_Door__c,
                                                               Quotation_Request__c,Quote_Model__c,
                                                               Accessory_Type__c,
                                                               Accessory_Details__c,
                                                               Accessory_Comments__c,
                                                               item_selection__c,
                                                               Other_Accessories__c FROM Accessory__c
                                                               where Quote_Model__c = :qm.id]) 
                                                 {                       
                                                   Accessory__c clonedAccessory = qmAcc.clone(false);
                                                   clonedAccessory.Quote_Model__c = newQM.id;
                                                   ModelAccessory.add(clonedAccessory);
                                                 }
                                      
                                 }
                              insert ModelAccessory;
                
                



         } catch (Exception e){
             // roll everything back in case of error
            Database.rollback(sp);
            ApexPages.addMessages(e);
            return null;
         }

        return new PageReference(&#039;/&#039;+newqReq.id+&#039;/e?retURL=%2F&#039;+newqReq.id);
    }

}</description>
		<content:encoded><![CDATA[<p>Hi Jeff,</p>
<p>I have utilized your deep clone functionality to fit our organizations needs. </p>
<p>Basically we have the following scenario :</p>
<p>We have a Quote Request, which has Vehicle Models related to it and you have accesories related to the models.</p>
<p>Below is the code we are using. The issue we are facing is if a quote has more than one Model it fails with the error :<br />
Record ID: cannot specify Id in an insert call</p>
<p>The Code works if there is 1 model with 1 or more accessories attached to it. The issue comes in when there is 2 or more vehicle models attached to a quote. </p>
<p>Is there any solution to the above issue we are facing?</p>
<p>===============================================<br />
public class QuotationRequestCloneWithItemsController {</p>
<p>    //added an instance varaible for the standard controller<br />
    private ApexPages.StandardController controller {get; set;}</p>
<p>    // add the instance for the variables being passed by id on the url<br />
    private Quotation_Request__c qReq {get;set;}</p>
<p>    // set the id of the record that is created &#8212; ONLY USED BY THE TEST CLASS<br />
    public ID newRecordId {get;set;}</p>
<p>    // initialize the controller<br />
    public QuotationRequestCloneWithItemsController(ApexPages.StandardController controller) {</p>
<p>        //initialize the stanrdard controller<br />
        this.controller = controller;</p>
<p>        // load the current record<br />
        qReq = (Quotation_Request__c)controller.getRecord();</p>
<p>    }</p>
<p>    // method called from the VF&#8217;s action attribute to clone the Quote request<br />
    public PageReference cloneWithItems() {</p>
<p>         // setup the save point for rollback<br />
         Savepoint sp = Database.setSavepoint();<br />
         Quotation_Request__c newqReq;</p>
<p>         try {</p>
<p>                              //copy the quote request &#8211; ONLY INCLUDE THE FIELDS YOU WANT TO CLONE<br />
                             qReq = [select Account__c,<br />
                                     Arrears_Deal__c,<br />
                                     Call_Report__c,<br />
                                     Call_Report_Vehicle__c,<br />
                                     Canopies_Comments__c,<br />
                                     Canopies_Door__c,<br />
                                     Canopies_Material__c,<br />
                                     Canopies_Sliding_Windows__c,<br />
                                     Canopies_Windows__c,<br />
                                     Checked__c,<br />
                                     Contact_Person__c,<br />
                                     Customer__c,<br />
                                     Customer_Nominated_Accessory_Supplier__c,<br />
                                     Customer_Nominated_Supplier__c,<br />
                                     Date__c,<br />
                                     Deposit_Ex_VAT__c,<br />
                                     FAM__c,<br />
                                     Fuel_Cards__c,<br />
                                     Insurance__c,<br />
                                     Interest_Rate__c,<br />
                                     Lead__c,<br />
                                     License__c,<br />
                                     Medical_Aid_Kit__c,<br />
                                     Nominated_Residual__c,<br />
                                     Personalised_Number_Plates__c,<br />
                                     Product__c,<br />
                                     Prospects__c,<br />
                                     Quotation_Pricing_Method__c,<br />
                                     Name,<br />
                                     RV__c,<br />
                                     ID,<br />
                                     Registered_Driver_Proxy__c,<br />
                                     Supplier_Name_Accessory__c,<br />
                                     Supplier_Name__c,<br />
                                     System_Parameters__c,<br />
                                     Tracking_Unit__c,<br />
                                     Tracking_Unit_Installation__c,<br />
                                     Tracking_Unit_Subscription__c,<br />
                                     Value_Add_Comment__c<br />
                                     from Quotation_Request__c where id = :qReq.id];<br />
                             newqReq = qReq.clone(false);<br />
                             insert newqReq;</p>
<p>                             //set the id of the new Quote Request to be inserted<br />
                             newRecordId = newqReq.id;</p>
<p>                           // copy over the models &#8211; ONLY INCLUDE THE FIELDS YOU WANT TO CLONE &#8212;<br />
                            List Models = new List();<br />
                            List ModelAccessory = new List();</p>
<p>                            for (Quote_Model__c qm : [Select Models__c,<br />
                            name,<br />
                            make_description__c,<br />
                            X1_Contract_Months__c,<br />
                            X1_KM__c,<br />
                            X2_Contract_Months__c,<br />
                            X2_KM__c,<br />
                            X3_Contract_Months__c,<br />
                            X3_KM__c,<br />
                            X4_Contract_Months__c,<br />
                            X4_KM__c,No_of_Units__c,<br />
                            m_m_number__c,<br />
                            Required_Delivery_Date__c,<br />
                            Delivery_Province__c,<br />
                            Availability__c,<br />
                            Required_Delivery_Area__c,<br />
                            Comments__c,<br />
                            Discontinued_Date__c,<br />
                            Barred_Date__c<br />
                            from Quote_Model__c<br />
                            where Quotation_Request__c = :qReq.id]) </p>
<p>                                  {<br />
                                    Quote_Model__c newQM = qm.clone(false);<br />
                                    newQM.Quotation_Request__c = newqReq.id;<br />
                                    Models.add(newQM);<br />
                                    insert Models;                                    </p>
<p>                                    //get accessories per model<br />
                                    for (Accessory__c qmAcc : [SELECT Accessory_Number__c,<br />
                                                               Canopies_Comments__c,Canopies_Door__c,<br />
                                                               Quotation_Request__c,Quote_Model__c,<br />
                                                               Accessory_Type__c,<br />
                                                               Accessory_Details__c,<br />
                                                               Accessory_Comments__c,<br />
                                                               item_selection__c,<br />
                                                               Other_Accessories__c FROM Accessory__c<br />
                                                               where Quote_Model__c = :qm.id])<br />
                                                 {<br />
                                                   Accessory__c clonedAccessory = qmAcc.clone(false);<br />
                                                   clonedAccessory.Quote_Model__c = newQM.id;<br />
                                                   ModelAccessory.add(clonedAccessory);<br />
                                                 }</p>
<p>                                 }<br />
                              insert ModelAccessory;</p>
<p>         } catch (Exception e){<br />
             // roll everything back in case of error<br />
            Database.rollback(sp);<br />
            ApexPages.addMessages(e);<br />
            return null;<br />
         }</p>
<p>        return new PageReference(&#8216;/&#8217;+newqReq.id+&#8217;/e?retURL=%2F&#8217;+newqReq.id);<br />
    }</p>
<p>}</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Visualforce Page with Pagination by Krishna</title>
		<link>http://blog.jeffdouglas.com/2009/07/14/visualforce-page-with-pagination/comment-page-1/#comment-7429</link>
		<dc:creator>Krishna</dc:creator>
		<pubDate>Fri, 25 Nov 2011 21:06:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=1012#comment-7429</guid>
		<description>Jeff,

I have a similar issue as Jimmy_Jenkins... Can you please help?</description>
		<content:encoded><![CDATA[<p>Jeff,</p>
<p>I have a similar issue as Jimmy_Jenkins&#8230; Can you please help?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

