• Shunn
  • NEWBIE
  • 45 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 17
    Replies
Hi All,

I am no developer. I have this test class in sandbox. I tried to deploy it to production and I am hitting a code coverage error(Code Coverage Failure. Your code coverage is 0%. You need at least 75% coverage to complete this deployment.
PBBRunAssignmentRules)


. see the class here:

// Digital Pi - This Apex class is used to reassign a lead using standard assignment rules
public with sharing class PBBRunAssignmentRules {
@InvocableMethod(label='Re-run Assignment Rules on Lead')
public static void ReRunAssignmentRules(list<string> recordIds) {

set<id> LeadIds = new set<id>();

for (string recordId:recordIds){
id rid=id.valueOf(recordId);
Schema.SObjectType sot= rid.getSObjectType();
if (sot == Lead.sObjectType){
LeadIds.add(rid);
}
}

if (!LeadIds.isempty()){
//ID jobID = System.enqueueJob(new PBBLeadReassignQueueable(LeadIds));
if (system.isFuture()) {
system.debug('running in future already; exiting!');
return;
} else {
system.debug('starting future call');
futureLeadReassign(LeadIds);
}
}
}

@future
public static void futureLeadReassign(Set<ID> ReassignSet) {

system.debug('in the future, doing lead reassignment');
List<Lead> UpdList = [SELECT Id FROM Lead WHERE Id IN: ReassignSet];

for (Lead l:UpdList) {
Database.DMLOptions dmo = new Database.DMLOptions();
dmo.assignmentRuleHeader.useDefaultRule = true;
// use leadAssignment rules when updating
l.setOptions(dmo);
}
system.debug(UpdList);
update(UpdList);
}
}


What do I need to do? Do I need a trigger or test class?  Any help with writing this test class please?
  • January 02, 2019
  • Like
  • 0
I think I need a trigger as Process builder doesnt seem to cut it for this use case. I am an admin and have ZERO coding experience and need a trigger help here.
I would want to be notified when there is a change on amount or probability field on the opportunity object and it is in the current quarter or next quarter – applies to all records. It should only apply to a product family type - Hardware and Services ONLY.
I would want to be notified if a new record is created in current or next quarter, and same goes for deletes, or a record is moved from current quarter to next quarter. Again, It should only apply to a product family type - Hardware and Services ONLY.

Any help with a trigger please? Thank you!
 
  • October 12, 2017
  • Like
  • 0
Hi All,

I need a trigger that when the Opportunity Product "line description" field is created or edited, the related Quote line item object "Description" field should also be created or updated. So basically,
A) Object = Opportunity Product 
Field = Line Description
B) Object = Quote Line Item 
Field = Line Description
Trigger on new or update
Field on object A , should be populated on Object B's field 

Can anyone help please?
  • May 04, 2017
  • Like
  • 0
Hi All,

I am not a developer at all and tried to deploy a small apex class from Sandbox to Production and hit this error below. Any help and/or guidance is highly appreciated
Screenshot of Error

Thank You
  • April 12, 2017
  • Like
  • 0
I am trying to do this challenges and I seem to have set everything up correctly but getting the error below:
Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Delete failed. First exception on row 0 with id 001d0000022M7lnAAC; first error: DELETE_FAILED, Your attempt to delete TestAccount could not be completed because it is associated with the following cases.: 00001348 : []

Any ideas?
  • May 26, 2016
  • Like
  • 0
Hi All,

I am no developer. I have this test class in sandbox. I tried to deploy it to production and I am hitting a code coverage error(Code Coverage Failure. Your code coverage is 0%. You need at least 75% coverage to complete this deployment.
PBBRunAssignmentRules)


. see the class here:

// Digital Pi - This Apex class is used to reassign a lead using standard assignment rules
public with sharing class PBBRunAssignmentRules {
@InvocableMethod(label='Re-run Assignment Rules on Lead')
public static void ReRunAssignmentRules(list<string> recordIds) {

set<id> LeadIds = new set<id>();

for (string recordId:recordIds){
id rid=id.valueOf(recordId);
Schema.SObjectType sot= rid.getSObjectType();
if (sot == Lead.sObjectType){
LeadIds.add(rid);
}
}

if (!LeadIds.isempty()){
//ID jobID = System.enqueueJob(new PBBLeadReassignQueueable(LeadIds));
if (system.isFuture()) {
system.debug('running in future already; exiting!');
return;
} else {
system.debug('starting future call');
futureLeadReassign(LeadIds);
}
}
}

@future
public static void futureLeadReassign(Set<ID> ReassignSet) {

system.debug('in the future, doing lead reassignment');
List<Lead> UpdList = [SELECT Id FROM Lead WHERE Id IN: ReassignSet];

for (Lead l:UpdList) {
Database.DMLOptions dmo = new Database.DMLOptions();
dmo.assignmentRuleHeader.useDefaultRule = true;
// use leadAssignment rules when updating
l.setOptions(dmo);
}
system.debug(UpdList);
update(UpdList);
}
}


What do I need to do? Do I need a trigger or test class?  Any help with writing this test class please?
  • January 02, 2019
  • Like
  • 0
Hi All,

I need a trigger that when the Opportunity Product "line description" field is created or edited, the related Quote line item object "Description" field should also be created or updated. So basically,
A) Object = Opportunity Product 
Field = Line Description
B) Object = Quote Line Item 
Field = Line Description
Trigger on new or update
Field on object A , should be populated on Object B's field 

Can anyone help please?
  • May 04, 2017
  • Like
  • 0
Hi All,

I am not a developer at all and tried to deploy a small apex class from Sandbox to Production and hit this error below. Any help and/or guidance is highly appreciated
Screenshot of Error

Thank You
  • April 12, 2017
  • Like
  • 0
I am getting this error below for the above challenge:
Challenge Not yet complete... here's what's wrong:
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: NIQZDKLE
I have a new org so not sure why I am getting this error
I am trying to do this challenges and I seem to have set everything up correctly but getting the error below:
Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Delete failed. First exception on row 0 with id 001d0000022M7lnAAC; first error: DELETE_FAILED, Your attempt to delete TestAccount could not be completed because it is associated with the following cases.: 00001348 : []

Any ideas?
  • May 26, 2016
  • Like
  • 0
Hello All,

I keep getting this error on this question:

Challenge not yet complete... here's what's wrong: 
An update to an account record failed to update the mailing address fields of all child contact records. Make sure that the process is correct and that it is activated.

Screenshot:
https://www.dropbox.com/s/30lrmgz8zogxulf/Screenshot%202015-03-23%2016.09.38.png?dl=0

Screenshot 2:

https://www.dropbox.com/s/5wrdht63l18591b/Screenshot%202015-03-23%2016.10.57.png?dl=0

I have gone over this many times and I would appreciate any help to get through this challenge!!


Thanks!
I'm doing the simple lightning components challenge and have hit this problem in my existing trailhead org and a brand new dev org that I've just created:

Challenge not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: QVWBQHAG