• Jamie Johnson
  • NEWBIE
  • 50 Points
  • Member since 2012

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 4
    Replies
I have several Apex test failures that have reduced my code coverage to 59%. The Apex Classes are no longer necessary and can be deleted. However, when I use Eclipse and Force.IDE to delete them in sandbox and try to move it to production, the coverage in production stops the deployment. 

Can someone give me very detailed instructions on how to get around this? I am not a developer and will need help navigating this problem.

Thanks so much for any help you can give.
 Eclipse code coverage failure
We received a notice that our certificate is being retired on August 7th.
Our SSO is Okta.
We asked Okta if this would have an impact on the sign in and this was their reply:

Okta don't validate the signature on the inbound SAML request from SFDC and we only grab the request ID. So I think you're safe on this end.

I want to make sure that we can safely disregard this notice. Okta is the only way our users can access Salesforce. If the retirement of the certificate causes our user to be locked out of OKTA, our users will be down. I apologize ahead of time, I really know very little about certificates and SSO. Thank you for any help.

The RFPforce from Salesforce labs is really great and our Company is really enjoying it. However, I now need move a new app from Sandbox to Production and I can't deploy because the Custom Object "Questions" with the trigger "AvoidDuplicateUsageEntry" created by the RFPforce app does not have an Apex test.

 

API NameTypeLineColumnProblem
AvoidDuplicateUsageEntry   Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required

 

NameAvoidDuplicateUsageEntrySobject TypeQuestion
Is ValidCode Coverage0%

 

I was thinking if could add a new Apex test in the Production environment it would clear this error - and then push over the new app.  Is that correct?

 

Can someone help me write the test? I don't know anything about development and I don't know where to go for assistance.

This is the trigger in the "Questions" custom object:

 

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
trigger AvoidDuplicateUsageEntry on Question__c (before insert) 
{
    for (Question__c question: Trigger.new)
    {
        if (question.Override_Warning__c == false)
        {
            try
            {
              Question__c[] q = [SELECT q.CreatedById, q.CreatedDate, q.Question__c from Question__c q where q.Response__c = :question.Response__c and q.RFP__c = :question.RFP__c ORDER BY CreatedDate desc];
              if (q.size() > 0)
              {
                  User u = [SELECT u.Name from User u where id = :q[0].CreatedById];
                  String questionStr = String.escapeSingleQuotes(q[0].Question__c);
                  questionStr = questionStr.replace('\"', '\\\"');
                  String userStr = String.escapeSingleQuotes(u.Name);
                  userStr = userStr.replace('\"', '\\\"');
                  String dateStr = q[0].CreatedDate.format('MM/dd/yyyy hh:mm a');
                  String errorJSON = 'var errorJSON = {timesUsed: ' + q.size() + ', question: \"' + questionStr + '\", user: \"' + userStr + '\", time: \"' + dateStr + '\"};';  
                  question.Response__c.addError(errorJSON);
              } // endif
            }
            catch (QueryException e)
            {
                // This is actually the non-error case.  The Question should not 
                // already exist.  Do nothing.
            }
        } // endif
    } // endfor
}

 

Any help at all would be greatly appreciated.

I have a failed Deployment in an inbound Change set:

AvoidDuplicateUsageEntry   Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required

 

AvoidDuplicateUsageEntry is an Apex Trigger and the Code Coverage is 0%

This apex trigger was part of an RFP package from Salesforce labs that created a Custom Object named Questions. It has not failed before??

 

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
trigger AvoidDuplicateUsageEntry on Question__c (before insert) 
{
    for (Question__c question: Trigger.new)
    {
        if (question.Override_Warning__c == false)
        {
            try
            {
              Question__c[] q = [SELECT q.CreatedById, q.CreatedDate, q.Question__c from Question__c q where q.Response__c = :question.Response__c and q.RFP__c = :question.RFP__c ORDER BY CreatedDate desc];
              if (q.size() > 0)
              {
                  User u = [SELECT u.Name from User u where id = :q[0].CreatedById];
                  String questionStr = String.escapeSingleQuotes(q[0].Question__c);
                  questionStr = questionStr.replace('\"', '\\\"');
                  String userStr = String.escapeSingleQuotes(u.Name);
                  userStr = userStr.replace('\"', '\\\"');
                  String dateStr = q[0].CreatedDate.format('MM/dd/yyyy hh:mm a');
                  String errorJSON = 'var errorJSON = {timesUsed: ' + q.size() + ', question: \"' + questionStr + '\", user: \"' + userStr + '\", time: \"' + dateStr + '\"};';  
                  question.Response__c.addError(errorJSON);
              } // endif
            }
            catch (QueryException e)
            {
                // This is actually the non-error case.  The Question should not 
                // already exist.  Do nothing.
            }
        } // endif
    } // endfor
}

 

In any case, I can't seem to find out how to fix this failure so I can deploy my inbound change set.

 

I am a beginner and need a little help.

 

thanks!

 

 

The RFPforce from Salesforce labs is really great and our Company is really enjoying it. However, I now need move a new app from Sandbox to Production and I can't deploy because the Custom Object "Questions" with the trigger "AvoidDuplicateUsageEntry" created by the RFPforce app does not have an Apex test.

 

API NameTypeLineColumnProblem
AvoidDuplicateUsageEntry   Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required

 

NameAvoidDuplicateUsageEntrySobject TypeQuestion
Is ValidCode Coverage0%

 

I was thinking if could add a new Apex test in the Production environment it would clear this error - and then push over the new app.  Is that correct?

 

Can someone help me write the test? I don't know anything about development and I don't know where to go for assistance.

This is the trigger in the "Questions" custom object:

 

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
trigger AvoidDuplicateUsageEntry on Question__c (before insert) 
{
    for (Question__c question: Trigger.new)
    {
        if (question.Override_Warning__c == false)
        {
            try
            {
              Question__c[] q = [SELECT q.CreatedById, q.CreatedDate, q.Question__c from Question__c q where q.Response__c = :question.Response__c and q.RFP__c = :question.RFP__c ORDER BY CreatedDate desc];
              if (q.size() > 0)
              {
                  User u = [SELECT u.Name from User u where id = :q[0].CreatedById];
                  String questionStr = String.escapeSingleQuotes(q[0].Question__c);
                  questionStr = questionStr.replace('\"', '\\\"');
                  String userStr = String.escapeSingleQuotes(u.Name);
                  userStr = userStr.replace('\"', '\\\"');
                  String dateStr = q[0].CreatedDate.format('MM/dd/yyyy hh:mm a');
                  String errorJSON = 'var errorJSON = {timesUsed: ' + q.size() + ', question: \"' + questionStr + '\", user: \"' + userStr + '\", time: \"' + dateStr + '\"};';  
                  question.Response__c.addError(errorJSON);
              } // endif
            }
            catch (QueryException e)
            {
                // This is actually the non-error case.  The Question should not 
                // already exist.  Do nothing.
            }
        } // endif
    } // endfor
}

 

Any help at all would be greatly appreciated.

I have a failed Deployment in an inbound Change set:

AvoidDuplicateUsageEntry   Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required

 

AvoidDuplicateUsageEntry is an Apex Trigger and the Code Coverage is 0%

This apex trigger was part of an RFP package from Salesforce labs that created a Custom Object named Questions. It has not failed before??

 

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
trigger AvoidDuplicateUsageEntry on Question__c (before insert) 
{
    for (Question__c question: Trigger.new)
    {
        if (question.Override_Warning__c == false)
        {
            try
            {
              Question__c[] q = [SELECT q.CreatedById, q.CreatedDate, q.Question__c from Question__c q where q.Response__c = :question.Response__c and q.RFP__c = :question.RFP__c ORDER BY CreatedDate desc];
              if (q.size() > 0)
              {
                  User u = [SELECT u.Name from User u where id = :q[0].CreatedById];
                  String questionStr = String.escapeSingleQuotes(q[0].Question__c);
                  questionStr = questionStr.replace('\"', '\\\"');
                  String userStr = String.escapeSingleQuotes(u.Name);
                  userStr = userStr.replace('\"', '\\\"');
                  String dateStr = q[0].CreatedDate.format('MM/dd/yyyy hh:mm a');
                  String errorJSON = 'var errorJSON = {timesUsed: ' + q.size() + ', question: \"' + questionStr + '\", user: \"' + userStr + '\", time: \"' + dateStr + '\"};';  
                  question.Response__c.addError(errorJSON);
              } // endif
            }
            catch (QueryException e)
            {
                // This is actually the non-error case.  The Question should not 
                // already exist.  Do nothing.
            }
        } // endif
    } // endfor
}

 

In any case, I can't seem to find out how to fix this failure so I can deploy my inbound change set.

 

I am a beginner and need a little help.

 

thanks!