• askmikem
  • NEWBIE
  • 5 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 5
    Replies
We are seeing an error in one of our classes where we are exceeding CPU time.  Added some debug statements to the code has determined that a large SOQL statement is to blame.   Any ideas to avoid this?  I was unde the impression that SOQL statements are excluded from the CPU time calculation.

I have included the pertinent section of the log, in case you don't believe me ;)

12:43:48.0 (239206415)|USER_DEBUG|[379]|INFO|mikem4b.Amount of CPU Time: 177
12:43:48.0 (243726579)|SOQL_EXECUTE_BEGIN|[381]|Aggregations:0|SELECT Id,IsDeleted,LineNumber,CurrencyIsoCode,CreatedDate,CreatedById,LastModifiedDate,LastModifiedById,SystemModstamp,QuoteId,PricebookEntryId,Quantity,UnitPrice,Discount,Description,ServiceDate,Product2Id,SortOrder,ListPrice,Subtotal,TotalPrice,BT_Account_Name__c,BT_Contact__c,BT_Address_Usage__c,BT_Contact_First_Name__c,BT_Contact_Last_Name__c,BT_Sales_Channel__c,BT_Country_of_revenue__c,BT_Oracle_customer__c,BT_Bill_to_account_site_ID__c,BT_Address__c,BT_City__c,BT_State__c,BT_Postal_Code__c,BT_Country__c,ST_Account_Name__c,EU_Account_Name__c,Opportunity_Account__c,ST_Address__c,EU_Address__c,ST_Address_Usage__c,EU_Address_Usage__c,ST_Ship_to_account_site_ID__c,FPX_ListPrice__c,EU_End_User_account_site_ID__c,ST_City__c,EU_City__c,ST_Contact__c,EU_Contact__c,ST_Country__c,EU_Country__c,ST_Country_of_revenue__c,EU_Country_of_revenue__c,ST_Oracle_customer__c,EU_Oracle_customer__c,ST_Postal_Code__c,EU_Postal_Code__c,ST_State__c,EU_State__c,ST_Contact_Role__c,BT_Contact_Role__c,EU_Contact_Role__c,Select_Bill_To_Contact__c,Select_Ship_To_Contact__c,Select_Installed_At_Contact__c,Delivery_Instructions_DI__c,Delivery_Contact__c,Primary_Quote_Flag__c,Quote__c,Revision__c,Quote_Name__c,Status__c,Order__c,Order_Status__c,Price_List__c,Active__c,PO_Received__c,PO_Received_By__c,PO_Received_Date__c,Currency__c,Quote_Expiry_Date__c,Comments__c,Requested_Delivery_Date__c,Oracle_Order__c,Install_At_Country__c,CERTS_Sub_Status__c,Total_Gross_Revenue__c,Cost_Center__c,Sent_To_NetSuite__c,Internal_Comments__c,Last_Export_Date__c,Organization__c,Type__c,Select_Bill_To_Address_Usage__c,Action__c,Mode__c,Config_Complete__c,Ext_Qty__c,Asset_S_N__c,Base_S_N__c,Product_List_Price__c,Std_Buy_price__c,Product_Sub_Category__c,Net_Revenue__c,Cost__c,Marketing_Category__c,Gross_Margin__c,Gross_Margin_Percentage__c,Program_Discount_Value__c,Manual_Discount_Percentage__c,Deferred_Maint_Rev__c,Renewal_MMC__c,Current_Model_Version__c,Configured_Model_Version__c,Post_Program_Price__c,Product_Measure__c,Doc_Config__c,WCA_Amount__c,Line_Discount_Percentage__c,Item_Unit__c,Bundle_ID__c,Bundle_Description__c,Bundle_Modified__c,Bundle_Name__c,Solution_Selector__c,Expert_Mode__c,Base_Asset_Serial__c,Install_At_Address_Id__c,Install_At_Address_Name__c,Ship_To_Address_Id__c,Ship_To_Address_Name__c,Standard_Buy_Price__c,License_Type__c,MPD_Flag__c,MPD_Counter__c,Elapsed_Term__c,Product_Sub_Type__c,MPD_Adjustment__c,NS_Adjustment__c,Product_Term__c,Product_Type__c,Manual_Price_Override__c,Quote_SPT_Level__c,Quote_Upgrade_SPT_Level__c,Oracle_GL_Code__c,Unit_Cost__c,Covered_Product__c,Unit_Price_MMC__c,Unit_Net_MMC__c,NS_Flag__c,Product_Life_Cycle_Status__c,Unit_Product_List_Price__c,M_Code__c,Renewal_MMC_Override__c,M_Code_Description__c,ParentQuoteId__c,ParentQuoteLineId__c,IsSelected__c,ExtendedDescription__c,Key__c,BaseSellingPrice__c,UnitSellingPrice__c,TotalOptionsSellingPrice__c,TotalBaseSellingPrice__c,NestedProductsSellingPrice__c,OptionsSellingPrice__c,OptionsListPrice__c,OptionsCost__c,OptionsProfit__c,OptionsMargin__c,TotalCost__c,TotalProfit__c,TotalMargin__c,IncludeInExport__c,Sequence__c,OptionId__c,OptionType__c,ValueType__c,ValueString__c,ValueDate__c,ValueDouble__c,ValueColor__c,Extended_List_Price__c,Total_Post_Program_Discount__c,Standard_Discount__c,Standard_Discount_Value__c,List_Monthly_Maintenance_Charge__c,Quote_Monthly_Maintenance_Charge__c,Contractual_Rev_Rec_Trigger__c,Oracle_Site_Number_for_BillTo__c,Oracle_Site_Number_for_Install__c,Oracle_Site_Number_for_ShipTo__c,Parent_LIC__c,IA_Account_Name__c,IA_Contact__c,IA_Contact_Role__c,IA_Country_of_revenue__c,IA_Oracle_customer__c,IA_Oracle_Site_Number_for_Install__c,IA_End_User_account_site_ID__c,IA_Address_Usage__c,IA_Address__c,IA_City__c,IA_State__c,IA_Postal_Code__c,IA_Country__c,IA_Select_Installed_At_Contact__c,Marketing_Name__c,Pricing_Comments__c,Freight_Terms__c,Solution_Line_Item__c,Warranty_Cost_Accrual__c,Product_Level__c,Cost_Adjustments__c,Revenue_Adjustments__c,Warranty_Cost__c,Unit_of_Measurement__c,CPQ_Line_Number__c,Order_Code__c,Adjust_Lock__c,CPQ_Line_Id__c,S_Level_Line_Item__c,Product_Cost__c,IP_Flag__c,IPSN__c,Email__c,Shipment_Note__c,HW_Gross_Revenue__c,SW_Gross_Revenue__c,HW_Def_Maint_Revenue__c,SW_Def_Maint_Revenue__c,Install_Revenue__c,GSS_Revenue__c,Total_Products_Cost__c,Revenue_Adjustment_Value__c,Cost_Adjustment_Value__c,HW_Term__c,HW_MMC__c,SW_Term__c,SW_MMC__c,Third_Party_HW_Term__c,Third_Party_HW_MMC__c,Third_Party_SW_Term__c,Third_Party_SW_MMC__c,Gross_Revenue__c,SVC_Support_List_Price__c,Pricing_Category__c,Product_Category__c,VSOE_Discount__c,Hidden_Line_Number__c,Unit_List_MMC__c,Unit_Std_Buy_Price__c,Unit_List_Price__c,Select_Ship_To_Address_Usage__c,Select_End_User_Address_Usage__c,Solution_Level_Order_Code__c,S_Level_Order_Code__c,Product_Sequence__c,VSOE_Flag__c,ST_Contact_Email__c,BT_Address_Usage_Site__c,ST_Address_Usage_Site__c,Ref_QuoteLineItem__c,CPQ_Parent_Line_Id__c,Service_Sub_Type__c,Standard_Cost__c,Quote_Id__c,LIC_EXP__c,ELA_Cost__c,ELA_Revenue__c,Covered_Product_Quoteline_Id__c,ENC_R_count__c,CPQ_Parent_Quote_Id__c,BT_LocationNo__c,ST_LocationNo__c,EU_LocationNo__c,CPQ_Root_Line_Id__c,Total_PII__c,Renewal_MMC_List__c,Covered_Product_Quantity__c,Covered_Product_Sequence__c,MPD_Amount__c,Unit_PII__c,Post_Program_Discount_Amt__c,Unit_WCA_Amount__c,WCA_Flag__c,WCA_Term__c,Ref_Quote_Line_Item_Root__c,E_U_Address_Variation1__c,S_T_Address_Variation1__c,Quote_Line_Item_Reporting_Count__c,ECCN__c,Unit_Gross_Revenue__c,Total_Covered_Product_Qty__c,Product_life_Cycle_Status_Test__c,Line_No_Sort__c,Unit_Start_Price__c,S_Product_Family__c,Unit_Post_Program_Price__c,Service_Level__c,Opp_Acct_Formula__c,Pricebook_ID__c,Product_Life_Cycle_Test__c,Gross_Revenue_PCU__c,Net_Revenue_PCU__c,Gross_Margin_PCU__c FROM QuoteLineItem WHERE QuoteId = '0Q055000000ADSOCA4'
12:43:55.115 (7115185345)|SOQL_EXECUTE_END|[381]|Rows:1767
12:43:55.115 (7193873495)|USER_DEBUG|[384]|INFO|mikem1a.Number of Queries: 2
12:43:55.115 (7193919303)|USER_DEBUG|[385]|INFO|mikem2a.Number of rows: 1815
12:43:55.115 (7193967779)|USER_DEBUG|[386]|INFO|mikem3a.Number of script statements: 0
12:43:55.115 (7194014499)|USER_DEBUG|[387]|INFO|mikem4a.Amount of CPU Time: 5352
 
We are seeing an error in one of our classes where we are exceeding CPU time.  Added some debug statements to the code has determined that a large SOQL statement is to blame.   Any ideas to avoid this?  I was unde the impression that SOQL statements are excluded from the CPU time calculation.

I have included the pertinent section of the log, in case you don't believe me ;)

12:43:48.0 (239206415)|USER_DEBUG|[379]|INFO|mikem4b.Amount of CPU Time: 177
12:43:48.0 (243726579)|SOQL_EXECUTE_BEGIN|[381]|Aggregations:0|SELECT Id,IsDeleted,LineNumber,CurrencyIsoCode,CreatedDate,CreatedById,LastModifiedDate,LastModifiedById,SystemModstamp,QuoteId,PricebookEntryId,Quantity,UnitPrice,Discount,Description,ServiceDate,Product2Id,SortOrder,ListPrice,Subtotal,TotalPrice,BT_Account_Name__c,BT_Contact__c,BT_Address_Usage__c,BT_Contact_First_Name__c,BT_Contact_Last_Name__c,BT_Sales_Channel__c,BT_Country_of_revenue__c,BT_Oracle_customer__c,BT_Bill_to_account_site_ID__c,BT_Address__c,BT_City__c,BT_State__c,BT_Postal_Code__c,BT_Country__c,ST_Account_Name__c,EU_Account_Name__c,Opportunity_Account__c,ST_Address__c,EU_Address__c,ST_Address_Usage__c,EU_Address_Usage__c,ST_Ship_to_account_site_ID__c,FPX_ListPrice__c,EU_End_User_account_site_ID__c,ST_City__c,EU_City__c,ST_Contact__c,EU_Contact__c,ST_Country__c,EU_Country__c,ST_Country_of_revenue__c,EU_Country_of_revenue__c,ST_Oracle_customer__c,EU_Oracle_customer__c,ST_Postal_Code__c,EU_Postal_Code__c,ST_State__c,EU_State__c,ST_Contact_Role__c,BT_Contact_Role__c,EU_Contact_Role__c,Select_Bill_To_Contact__c,Select_Ship_To_Contact__c,Select_Installed_At_Contact__c,Delivery_Instructions_DI__c,Delivery_Contact__c,Primary_Quote_Flag__c,Quote__c,Revision__c,Quote_Name__c,Status__c,Order__c,Order_Status__c,Price_List__c,Active__c,PO_Received__c,PO_Received_By__c,PO_Received_Date__c,Currency__c,Quote_Expiry_Date__c,Comments__c,Requested_Delivery_Date__c,Oracle_Order__c,Install_At_Country__c,CERTS_Sub_Status__c,Total_Gross_Revenue__c,Cost_Center__c,Sent_To_NetSuite__c,Internal_Comments__c,Last_Export_Date__c,Organization__c,Type__c,Select_Bill_To_Address_Usage__c,Action__c,Mode__c,Config_Complete__c,Ext_Qty__c,Asset_S_N__c,Base_S_N__c,Product_List_Price__c,Std_Buy_price__c,Product_Sub_Category__c,Net_Revenue__c,Cost__c,Marketing_Category__c,Gross_Margin__c,Gross_Margin_Percentage__c,Program_Discount_Value__c,Manual_Discount_Percentage__c,Deferred_Maint_Rev__c,Renewal_MMC__c,Current_Model_Version__c,Configured_Model_Version__c,Post_Program_Price__c,Product_Measure__c,Doc_Config__c,WCA_Amount__c,Line_Discount_Percentage__c,Item_Unit__c,Bundle_ID__c,Bundle_Description__c,Bundle_Modified__c,Bundle_Name__c,Solution_Selector__c,Expert_Mode__c,Base_Asset_Serial__c,Install_At_Address_Id__c,Install_At_Address_Name__c,Ship_To_Address_Id__c,Ship_To_Address_Name__c,Standard_Buy_Price__c,License_Type__c,MPD_Flag__c,MPD_Counter__c,Elapsed_Term__c,Product_Sub_Type__c,MPD_Adjustment__c,NS_Adjustment__c,Product_Term__c,Product_Type__c,Manual_Price_Override__c,Quote_SPT_Level__c,Quote_Upgrade_SPT_Level__c,Oracle_GL_Code__c,Unit_Cost__c,Covered_Product__c,Unit_Price_MMC__c,Unit_Net_MMC__c,NS_Flag__c,Product_Life_Cycle_Status__c,Unit_Product_List_Price__c,M_Code__c,Renewal_MMC_Override__c,M_Code_Description__c,ParentQuoteId__c,ParentQuoteLineId__c,IsSelected__c,ExtendedDescription__c,Key__c,BaseSellingPrice__c,UnitSellingPrice__c,TotalOptionsSellingPrice__c,TotalBaseSellingPrice__c,NestedProductsSellingPrice__c,OptionsSellingPrice__c,OptionsListPrice__c,OptionsCost__c,OptionsProfit__c,OptionsMargin__c,TotalCost__c,TotalProfit__c,TotalMargin__c,IncludeInExport__c,Sequence__c,OptionId__c,OptionType__c,ValueType__c,ValueString__c,ValueDate__c,ValueDouble__c,ValueColor__c,Extended_List_Price__c,Total_Post_Program_Discount__c,Standard_Discount__c,Standard_Discount_Value__c,List_Monthly_Maintenance_Charge__c,Quote_Monthly_Maintenance_Charge__c,Contractual_Rev_Rec_Trigger__c,Oracle_Site_Number_for_BillTo__c,Oracle_Site_Number_for_Install__c,Oracle_Site_Number_for_ShipTo__c,Parent_LIC__c,IA_Account_Name__c,IA_Contact__c,IA_Contact_Role__c,IA_Country_of_revenue__c,IA_Oracle_customer__c,IA_Oracle_Site_Number_for_Install__c,IA_End_User_account_site_ID__c,IA_Address_Usage__c,IA_Address__c,IA_City__c,IA_State__c,IA_Postal_Code__c,IA_Country__c,IA_Select_Installed_At_Contact__c,Marketing_Name__c,Pricing_Comments__c,Freight_Terms__c,Solution_Line_Item__c,Warranty_Cost_Accrual__c,Product_Level__c,Cost_Adjustments__c,Revenue_Adjustments__c,Warranty_Cost__c,Unit_of_Measurement__c,CPQ_Line_Number__c,Order_Code__c,Adjust_Lock__c,CPQ_Line_Id__c,S_Level_Line_Item__c,Product_Cost__c,IP_Flag__c,IPSN__c,Email__c,Shipment_Note__c,HW_Gross_Revenue__c,SW_Gross_Revenue__c,HW_Def_Maint_Revenue__c,SW_Def_Maint_Revenue__c,Install_Revenue__c,GSS_Revenue__c,Total_Products_Cost__c,Revenue_Adjustment_Value__c,Cost_Adjustment_Value__c,HW_Term__c,HW_MMC__c,SW_Term__c,SW_MMC__c,Third_Party_HW_Term__c,Third_Party_HW_MMC__c,Third_Party_SW_Term__c,Third_Party_SW_MMC__c,Gross_Revenue__c,SVC_Support_List_Price__c,Pricing_Category__c,Product_Category__c,VSOE_Discount__c,Hidden_Line_Number__c,Unit_List_MMC__c,Unit_Std_Buy_Price__c,Unit_List_Price__c,Select_Ship_To_Address_Usage__c,Select_End_User_Address_Usage__c,Solution_Level_Order_Code__c,S_Level_Order_Code__c,Product_Sequence__c,VSOE_Flag__c,ST_Contact_Email__c,BT_Address_Usage_Site__c,ST_Address_Usage_Site__c,Ref_QuoteLineItem__c,CPQ_Parent_Line_Id__c,Service_Sub_Type__c,Standard_Cost__c,Quote_Id__c,LIC_EXP__c,ELA_Cost__c,ELA_Revenue__c,Covered_Product_Quoteline_Id__c,ENC_R_count__c,CPQ_Parent_Quote_Id__c,BT_LocationNo__c,ST_LocationNo__c,EU_LocationNo__c,CPQ_Root_Line_Id__c,Total_PII__c,Renewal_MMC_List__c,Covered_Product_Quantity__c,Covered_Product_Sequence__c,MPD_Amount__c,Unit_PII__c,Post_Program_Discount_Amt__c,Unit_WCA_Amount__c,WCA_Flag__c,WCA_Term__c,Ref_Quote_Line_Item_Root__c,E_U_Address_Variation1__c,S_T_Address_Variation1__c,Quote_Line_Item_Reporting_Count__c,ECCN__c,Unit_Gross_Revenue__c,Total_Covered_Product_Qty__c,Product_life_Cycle_Status_Test__c,Line_No_Sort__c,Unit_Start_Price__c,S_Product_Family__c,Unit_Post_Program_Price__c,Service_Level__c,Opp_Acct_Formula__c,Pricebook_ID__c,Product_Life_Cycle_Test__c,Gross_Revenue_PCU__c,Net_Revenue_PCU__c,Gross_Margin_PCU__c FROM QuoteLineItem WHERE QuoteId = '0Q055000000ADSOCA4'
12:43:55.115 (7115185345)|SOQL_EXECUTE_END|[381]|Rows:1767
12:43:55.115 (7193873495)|USER_DEBUG|[384]|INFO|mikem1a.Number of Queries: 2
12:43:55.115 (7193919303)|USER_DEBUG|[385]|INFO|mikem2a.Number of rows: 1815
12:43:55.115 (7193967779)|USER_DEBUG|[386]|INFO|mikem3a.Number of script statements: 0
12:43:55.115 (7194014499)|USER_DEBUG|[387]|INFO|mikem4a.Amount of CPU Time: 5352
 
I am trying to write a trigger that will update a picklist field on the lead object. So when a lead has an activity added such as a call or email I would like for the lead status picklist to be updated from Not Contacted/New to Contacted. Thank for your help.

Hi,

 

I am trying to use the new feature in Winter Release 13 (Test.LoadData) but I keep receiving this error:

System.UnexpectedException: Salesforce System Error: 1705006492-5272 (-1190835780) (-1190835780)

 

All I did is added a CSV as a Static Resource and below is the CSV:

of_Expected_Converted_Loans__c,Swap_Curve__c,Missing_converted_loans__c,Loans_prchsd_at_premium_after_Def__c,Total_Amount_to_Snap_Prior_to_Holdback__c,Total_Loans__c,Deferral_Amount__c,Contracts_in_Deferral__c,Indication_Rate_Pricing_Date__c,Tranche_ID_external_ID__c,Tranche_Notes__c,Payment_Holdback__c,of_Loans_w_client_rate_RBC_Rate__c,Purchase_Date__c,In_term_Amount__c,Final_FTP_Diff_Max__c,PSA_Date__c,of_Converted_Loans__c,Windows_and_Doors__c,Holdback_Collected_on_Prior_Purchase__c,Weighted_Average_Bureau_Score__c,of_Loans_without_FTP_Indication__c,Name,of_Loans_without_LTFP_Indication__c,Face_Value_of_Converted_Deferrals__c,of_Loans_expected_for_repurchase__c,Weighted_Avg_Rate_for_Deferral_Loans__c,Total_of_Contracts__c,FTP_Output__c,FTP_Date__c,Final_FTP_Diff_Min__c,of_Loans_without_Final_FTP_Actual__c,Premium__c,FTP_Process_Date__c,Net_Amount_to_Snap__c,Stage_Owner__c,Stage__c,of_Loans_older_than_6_months__c,Weighted_Avg_Disc_Rate_for_loan_in_RPay__c,Below_620_Bureau_Score__c,Tranche_contains_rejected_Loans__c,Total_Assignment_Amount__c,of_Loans_without_PPayment_Indication__c,Final_FTP_Diff_Avg__c,of_Unexpected_Converted_Loans__c
0,,FALSE,67.29559748,2328286.04,318,711881.56,32.70440252,10/04/2012,,,101242.08,0,16/04/2012,1312958.76,0.0591,,0,18.44434874,67467.41,729.6864676,0,730,0,0,0,4.203527258,318,a0AS0000004uGsTMAU,16/04/2012,-0.1957,0,303445.72,20/04/2012,2294511.37,,Stage 1: Review,46,5.417701104,6.315508869,FALSE,2024840.32,0,-0.102136164,318

 

And here is my code:

 

static testMethod void testFullCycle() {
List<sObject> ls = Test.loadData(Tranche__c.sObjectType, 'TestData_01_01_Tranche');
insert ls;

}

 

The error is reported in the first line of the function. I don't know what exactly is the problem, so if anyone can help?

I am trying to deploy one class which has implemented Schedulable interface.

But when I try to deploy it using ANT I am getting the following error :

"Schedulable class has jobs pending or in progress".

 

I am waiting for this to get resolved since more than 48 hrs and it doesn't seem to resolve.

What can be done in such case? How to deploy it to production? I tried to deploy by making packages but could not since the components in the package already exist in production and gives an error when I unzip the package. Please suggest what can be done in this situation.

  • March 26, 2010
  • Like
  • 0