• Rajesh Yandrathi 1
  • NEWBIE
  • 45 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 6
    Replies
Platform Developer I Certification Maintenance (Summer '19)  Challenege code
********************************************************************************
Modify an existing batch Apex job to raise BatchApexErrorEvents

Take an existing batch Apex job class and update it to implement the Database.RaisesPlatformEvents interface. Then, add a trigger on BatchApexErrorEvent that logs exceptions in the batch job to a custom object.
Update the BatchLeadConvert class to implement the Database.RaisesPlatformEvents marker interface.

Create an Apex trigger called BatchApexErrorTrigger on the BatchApexErrorEvent SObject type. For each event record, capture the following fields and save them to the corresponding fields in a new BatchLeadConvertErrors__c record.
AsyncApexJobId: AsyncApexJobId__c
JobScope: Records__c
StackTrace: StackTrace__c
To make the trigger bulk safe, use a single DML statement to insert a list of new records at the end.
****************************************************************



trigger BatchApexErrorTrigger on BatchApexErrorEvent (after insert) {
    
   list<BatchLeadConvertErrors__c> bcr= new List<BatchLeadConvertErrors__c>();
    
    for(BatchApexErrorEvent event: trigger.new){
        
        BatchLeadConvertErrors__c  evrterror= new BatchLeadConvertErrors__c ();
        
        evrterror.AsyncApexJobId__c= event.AsyncApexJobId;
        evrterror.Records__c=event.JobScope;
        evrterror.StackTrace__c=event.StackTrace;     
        bcr.add(evrterror);    
    }
    
    if(bcr.size()>0){
        
        insert bcr;
    }

}

*************************************************************
BatchLeadConvert Apex Batch Class

public with sharing class BatchLeadConvert implements Database.Batchable<SObject>, Database.RaisesPlatformEvents{

// Not be bothered whats here. Just Implement Raises Platform Events Interface.
}

 
Hello there,

I am stuck at the second step in the Billing Specialist superbadge with the following error : 
Challenge Not yet complete... here's what's wrong: 
We couldn't find the Consumption Schedule named 'Panel Maintenance Request'. Please make sure the Consumption Schedule exists, the record contains the correct values according to the requirements and please try again.

I do have created a Consumption Schedule related to Major Solar Panel product :
User-added imagewith the following Consumption Rates :
User-added imageUser-added image
Hi there, 

i am having a little trouble with lecture 5 of the "Customize Your Community - Share CRM Data with Your Partners" project. After creating all sharing rules as stated in the lecture, I can not verifiy the step. I receive the error message 

"Step not yet complete in My Trailhead Playground 16
There was an unexpected error in your org which is preventing this assessment check from completing: System.QueryException: List has no rows for assignment to SObject"

I double and tripple checked the whole configuration, but can not find any mistake and because the project is very tideous, I hope to avoid doing it all over again. Is there something, I can do or check to repair my org and finally pass this lecture?

Thanks in advance! 
This Step of the Trailhead "" seams to have a BUG!:

After reviewing the exercise several times, I am getting this error: 
Step 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.QueryException: List has no rows for assignment to SObject

Is any want suffering the same issue?
Any tip?

Thank you very much.
  • September 27, 2018
  • Like
  • 0

Getting this error when changing I try to change the Name field from Text to AutoNumber.

 

Error: Cannot change Record Name type to autonumber; field update exists.

 

Any Ideas? Thanks in advance. 

  • February 24, 2010
  • Like
  • 0