• Tim Teague 4
  • NEWBIE
  • 15 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 4
    Replies
I am not a dev but I need to disable an apex trigger.  I've made it inactive in Sandbox but can not deploy in production. 

I have tried to deploy with its specific test class but the error I get is the following:

AccountUtilityTestClassvalidateTotalRollupRevenueFieldsSystem.DmlException: Upsert failed. First exception on row 0 with id 0060X00000WHqdCQAT; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, updatecontactrolecount: execution of BeforeUpdate caused by: System.LimitException: Too many SOQL queries: 101 Trigger.updatecontactrolecount: line 22, column 1: [] 
Stack Trace: Class.AccountUtilityTestClass.validateTotalRollupRevenueFields: line 80, column 1


Here is the Test Class

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
@isTest(SeeAllData=true)

private class AccountUtilityTestClass {
  
  static testMethod void validateTotalRollupRevenueFields() {
 
    Account TA1 = new Account(
      Name='Testaccount1',
      Region__c='EMEA',
      CurrencyIsoCode='GBP'           
    );
    upsert TA1;
     
    Account TA2 = new Account(
      Name='Testaccount2',
      Region__c='APAC',
      CurrencyIsoCode='USD',
      ParentId=TA1.Id          
    );
    upsert TA2;
    Opportunity TO2 = new Opportunity(
      Name='TestOpportunity2',
      Pricebook2Id=Test.getStandardPricebookId(),
      AccountId=TA2.Id,
      CurrencyIsoCode='USD',
      StageName='Closed Won',
      CloseDate=Date.today()
    );
    upsert TO2;
    Quote TQ2 = new Quote(
      OpportunityId=TO2.Id,
      Pricebook2Id=Test.getStandardPricebookId(),
      Name='Testquote2'
    );
    upsert TQ2;
    QuoteLineItem TQL2 = new QuoteLineItem(
      QuoteId=TQ2.Id,
      PricebookEntryId='01ub000000kbxgd',
      Quantity=1,
      Product2Id='01tb00000036P54',
      UnitPrice=Math.random()*1000,
      Partner_Revenue__c=Math.random()*1000
    );
    upsert TQL2;
    TO2.SyncedQuoteId = TQ2.Id;
    upsert TO2;

    Account TA3 = new Account(
      Name='Testaccount3',
      Region__c='APAC',
      CurrencyIsoCode='USD',
      ParentId=TA2.Id          
    );
    upsert TA3;
    Opportunity TO3 = new Opportunity(
      Name='TestOpportunity3',
      Pricebook2Id=Test.getStandardPricebookId(),
      AccountId=TA3.Id,
      CurrencyIsoCode='USD',
      StageName='Closed Won',
      CloseDate=Date.today()
    );
    upsert TO3;
    Quote TQ3 = new Quote(
      OpportunityId=TO3.Id,
      Pricebook2Id=Test.getStandardPricebookId(),
      Name='Testquote3'
    );
    upsert TQ3;
    QuoteLineItem TQL3 = new QuoteLineItem(
      QuoteId=TQ3.Id,
      PricebookEntryId='01ub000000kbxgd',
      Quantity=1,
      Product2Id='01tb00000036P54',
      UnitPrice=Math.random()*1000,
      Partner_Revenue__c=Math.random()*1000
    );
    upsert TQL3;
    TO3.SyncedQuoteId = TQ3.Id;
    upsert TO3;
     
    System.debug([SELECT Name, Total_Zappi_Revenue__c, Amount FROM Opportunity WHERE AccountId =: TA1.Id]);
    System.debug([SELECT Name, Total_Zappi_Revenue__c, Amount FROM Opportunity WHERE AccountId =: TA2.Id]);
    System.debug([SELECT Name, Total_Zappi_Revenue__c, Amount FROM Opportunity WHERE AccountId =: TA3.Id]);
     
  }

}


Any advice on this is really appreciated!!!!
I'm not a dev but getting this error when I try to mass update opps 

AcountUtilityTrigger: System.LimitException: Too many SOQL queries: 101

We installed an app called ContractPod could that of caused this?

I turned off all opp flows and rules and we still get this error. 

As an Admin , what can I do?
I need to make a Partner Role Required on an Opportunity if the check box "Invoice Partner" is checked?
How do we create an iframe inside Salesforce that we can enter data into and then pass the values of those fields into custom and standard SF fields?
Will the data pass quickly?
I have created a new opportunity button on an account to pre-complete some information

My last line is a custom field - How do I find out the opp? number key for these?

/006/e?retURL=/{!Account.Id}&
&opp3={!Account.Name} - &
&opp4={!Account.Name}&
&opp4_lkid={!Account.Id}
&opp5={!Opportunity.Opportunity_Driver__c}
&opp9={!Today}
&opp11=Product Interest
&{!Opportunity.Opportunity_Driver__c}=Zappi Led
I am not a dev but I need to disable an apex trigger.  I've made it inactive in Sandbox but can not deploy in production. 

I have tried to deploy with its specific test class but the error I get is the following:

AccountUtilityTestClassvalidateTotalRollupRevenueFieldsSystem.DmlException: Upsert failed. First exception on row 0 with id 0060X00000WHqdCQAT; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, updatecontactrolecount: execution of BeforeUpdate caused by: System.LimitException: Too many SOQL queries: 101 Trigger.updatecontactrolecount: line 22, column 1: [] 
Stack Trace: Class.AccountUtilityTestClass.validateTotalRollupRevenueFields: line 80, column 1


Here is the Test Class

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
@isTest(SeeAllData=true)

private class AccountUtilityTestClass {
  
  static testMethod void validateTotalRollupRevenueFields() {
 
    Account TA1 = new Account(
      Name='Testaccount1',
      Region__c='EMEA',
      CurrencyIsoCode='GBP'           
    );
    upsert TA1;
     
    Account TA2 = new Account(
      Name='Testaccount2',
      Region__c='APAC',
      CurrencyIsoCode='USD',
      ParentId=TA1.Id          
    );
    upsert TA2;
    Opportunity TO2 = new Opportunity(
      Name='TestOpportunity2',
      Pricebook2Id=Test.getStandardPricebookId(),
      AccountId=TA2.Id,
      CurrencyIsoCode='USD',
      StageName='Closed Won',
      CloseDate=Date.today()
    );
    upsert TO2;
    Quote TQ2 = new Quote(
      OpportunityId=TO2.Id,
      Pricebook2Id=Test.getStandardPricebookId(),
      Name='Testquote2'
    );
    upsert TQ2;
    QuoteLineItem TQL2 = new QuoteLineItem(
      QuoteId=TQ2.Id,
      PricebookEntryId='01ub000000kbxgd',
      Quantity=1,
      Product2Id='01tb00000036P54',
      UnitPrice=Math.random()*1000,
      Partner_Revenue__c=Math.random()*1000
    );
    upsert TQL2;
    TO2.SyncedQuoteId = TQ2.Id;
    upsert TO2;

    Account TA3 = new Account(
      Name='Testaccount3',
      Region__c='APAC',
      CurrencyIsoCode='USD',
      ParentId=TA2.Id          
    );
    upsert TA3;
    Opportunity TO3 = new Opportunity(
      Name='TestOpportunity3',
      Pricebook2Id=Test.getStandardPricebookId(),
      AccountId=TA3.Id,
      CurrencyIsoCode='USD',
      StageName='Closed Won',
      CloseDate=Date.today()
    );
    upsert TO3;
    Quote TQ3 = new Quote(
      OpportunityId=TO3.Id,
      Pricebook2Id=Test.getStandardPricebookId(),
      Name='Testquote3'
    );
    upsert TQ3;
    QuoteLineItem TQL3 = new QuoteLineItem(
      QuoteId=TQ3.Id,
      PricebookEntryId='01ub000000kbxgd',
      Quantity=1,
      Product2Id='01tb00000036P54',
      UnitPrice=Math.random()*1000,
      Partner_Revenue__c=Math.random()*1000
    );
    upsert TQL3;
    TO3.SyncedQuoteId = TQ3.Id;
    upsert TO3;
     
    System.debug([SELECT Name, Total_Zappi_Revenue__c, Amount FROM Opportunity WHERE AccountId =: TA1.Id]);
    System.debug([SELECT Name, Total_Zappi_Revenue__c, Amount FROM Opportunity WHERE AccountId =: TA2.Id]);
    System.debug([SELECT Name, Total_Zappi_Revenue__c, Amount FROM Opportunity WHERE AccountId =: TA3.Id]);
     
  }

}


Any advice on this is really appreciated!!!!
I'm not a dev but getting this error when I try to mass update opps 

AcountUtilityTrigger: System.LimitException: Too many SOQL queries: 101

We installed an app called ContractPod could that of caused this?

I turned off all opp flows and rules and we still get this error. 

As an Admin , what can I do?
How do we create an iframe inside Salesforce that we can enter data into and then pass the values of those fields into custom and standard SF fields?
Will the data pass quickly?
I have created a new opportunity button on an account to pre-complete some information

My last line is a custom field - How do I find out the opp? number key for these?

/006/e?retURL=/{!Account.Id}&
&opp3={!Account.Name} - &
&opp4={!Account.Name}&
&opp4_lkid={!Account.Id}
&opp5={!Opportunity.Opportunity_Driver__c}
&opp9={!Today}
&opp11=Product Interest
&{!Opportunity.Opportunity_Driver__c}=Zappi Led