Skip to main content

Platform Developer I Certification Maintenance (Summer '19)

1.What allows Flows to manipulate complex data types that are often returned from
calls to web services?

Answer:Apex Defined Data type

2. What is the benefit of using the Continuation class in Apex to make a long-running
request to an external web service?

ANS: more long-running callouts can be using as Continution

3. Which Lightning web component configuration file tag set specifies the form factors
that the component supports?

Ans: supportedFormFactors

4. Which tag adds the Lightning Web Components for Visualforce JavaScript library to a
Visualforce page?

Ans: <apex:includeLightning/>


Exercise :


  • Click this link: install Package
  • Update the BatchLeadConvert class to implement the Database.RaisesPlatformEvents marker interface. See below Example :
public with sharing class BatchLeadConvert implements
Database.Batchable<SObject>, Database.RaisesPlatformEvents {
// class implementation
}
  • Write a trigger on BatchApexErrorEvent object;
  • you can copy paste the below code in your trigger.
trigger BatchApexErrorTrigger on BatchApexErrorEvent (after insert) {
    list<BatchLeadConvertErrors__c> listBatchData = new list<BatchLeadConvertErrors__c>();
    for(BatchApexErrorEvent logData:trigger.new){
      BatchLeadConvertErrors__c newBatchTest = new BatchLeadConvertErrors__c();
       newBatchTest.AsyncApexJobId__c = logData.AsyncApexJobId;
       newBatchTest.Records__c =  logData.JobScope;
       newBatchTest.StackTrace__c =  logData.StackTrace;
       listBatchData.add(newBatchTest);
    }
    insert listBatchData;
}

Comments

  1. I am not able to install package in Playground Org.

    Install package is only install in dev org not in Playground Org.

    ReplyDelete
  2. Thanks Buddy. Without this I would be scratching my head for a long time.

    ReplyDelete
  3. Can you please share your contact details. I may have a business opportunity for you in Salesforce.

    ReplyDelete
  4. I've provided my contact details just check it on the left hand side menu icon. You'll find all the details.

    ReplyDelete
  5. Method does not exist or incorrect signature: void startTest() from the type test BatchLeadConvertTest: Method does not exist or incorrect signature: void startTest() from the type test
    Method does not exist or incorrect signature: void stopTest() from the type test BatchLeadConvertTest: Method does not exist or incorrect signature: void stopTest() from the type test
    Method does not exist or incorrect signature: void getEventBus() from the type test

    I am getting the error. Do you have any idea?

    ReplyDelete
    Replies
    1. Check the syntax just replace your test class with the following code :
      @isTest
      public class BatchLeadConvertTest {

      @isTest
      static void sanity(){
      Lead l = new Lead(
      FirstName = 'Bobby',
      LastName = 'Bobson',
      Company = 'Salesforce'
      );
      insert l;
      BatchLeadConvert job = new BatchLeadConvert();
      Test.startTest();
      Id jobId = Database.executeBatch(job);
      Test.stopTest();
      System.assertEquals(0, [SELECT NumberOfErrors FROM AsyncApexJob WHERE Id = :jobId].NumberOfErrors);
      }

      @isTest
      static void customObjectCreatedFromEventTrigger(){
      if(!isUpdatedForEvents()){
      return;
      }
      Lead errLead = new Lead(
      LastName = 'Astro DoNotConvert',
      Company = 'Trailhead'
      );
      insert errLead;

      BatchLeadConvert job = new BatchLeadConvert();
      Test.startTest();
      Id jobId = Database.executeBatch(job);
      try{
      Test.stopTest();
      }catch(DmlException ex){ /* don't fail this test if there were errors in the batch job - we want that */ }
      Test.getEventBus().deliver();

      List errorLogs = [SELECT id, StackTrace__c, Records__c FROM BatchLeadConvertErrors__c];
      System.assertEquals(1, errorLogs.size(), 'Expected errors converting DoNotConvertLeads');
      System.assert(errorLogs[0].Records__c.contains(errLead.Id), 'Expected "Astro DoNotConvert" Lead to fail to convert');
      }

      static Boolean isUpdatedForEvents(){
      ApexClass cls = [SELECT Body FROM ApexClass WHERE Name = 'BatchLeadConvert'];
      return cls.body.containsIgnoreCase('Database.RaisesPlatformEvents');
      }
      }

      Delete
    2. This comment has been removed by the author.

      Delete
    3. This test class covered the apex class but not trigger. Could you help me for covering this pd1 maintenance

      Delete
  6. I am getting the following error

    When executed, the BatchLeadConvertTest test class has test failures. All tests should pass.

    I have done everything as u sggested.

    ReplyDelete
  7. Hi Devraj,

    I won't be able to instal the package in my ORG and i am getting the above mentioned error. Please help.

    ReplyDelete
  8. Challenge not yet complete in My Trailhead Playground 1
    Verify the 'implements' list on BatchLeadConvert includes 'Database.RaisesPlatformEvents'

    I've done above all steps and still i'm getting this error. Could you please help out me on this.

    ReplyDelete
    Replies
    1. Verify your first line with the below lines.... It should be same...

      public with sharing class BatchLeadConvert implements
      Database.Batchable, Database.RaisesPlatformEvents {...}

      Delete
  9. I am not able to find BatchApexErrorEvent object.

    ReplyDelete
    Replies
    1. got it, it is not showing on UI, we need to check on developer console. Thanks

      Delete
  10. @Devraj Can you please help me. I am getting the error in the test class and i have not made any changes to the test class.

    When executed, the BatchLeadConvertTest test class has test failures. All tests should pass.

    ReplyDelete
    Replies
    1. Send me your credential on drajtomar@gmail.com i'll do. Or i'll send zip to replace your all existing classes.

      Delete
    2. Hi Devraj,
      please help me. I am getting the error in the test class and i have not made any changes to the test class.

      When executed, the BatchLeadConvertTest test class has test failures. All tests should pass

      Delete
  11. Hello Shivangi ,

    BatchApexErrorEvent values are not correctly assigned to BatchLeadConvertErrors__c fields in your trigger .
    In trigger , most probably you have assigned Records__c to RequestId but it should be assigned to JobScope .

    You may replace your trigger code by below lines of code :

    trigger BatchApexErrorTrigger on BatchApexErrorEvent (after insert) {
    list leadConvertErrorList = new list();
    for (BatchApexErrorEvent e : trigger.new) {
    leadConvertErrorList.add(new BatchLeadConvertErrors__c(AsyncApexJobId__c=e.AsyncApexJobId,Records__c=e.JobScope,StackTrace__c=e.StackTrace));
    }
    system.debug('*****leadConvertErrorList ***'+leadConvertErrorList);
    if (leadConvertErrorList.size() > 0 ) {
    Insert leadConvertErrorList;
    }

    }

    ReplyDelete
  12. Hi Devraj
    I cannot install the package, Getting this error
    Illegal assignment from List to ApexClass BatchLeadConvertTest: Illegal assignment from List to ApexClass
    Variable does not exist: body BatchLeadConvertTest: Variable does not exist: body

    ReplyDelete
    Replies
    1. This might be because of the existing changes in your org...

      Delete
  13. This comment has been removed by the author.

    ReplyDelete
  14. @Devraj Can you please help me. I am getting the error in the test class and i have not made any changes to the test class.

    When executed, the BatchLeadConvertTest test class has test failures. All tests should pass.
    I am Getting the same error when I execute the code, please can you help me ?

    ReplyDelete
  15. i am getting this error after i created Apex trigger,
    No Apex Trigger named 'BatchApexErrorTrigger' was found.

    ReplyDelete
  16. Hello, I have an invalid type error on BatchLeadConvertErrors in BatchApexErrorTrigger. Please could you help me?

    ReplyDelete
  17. Hi,
    I am not able to find the object "BatchApexErrorEvent" in Objects.. There is no New Trigger option also to write the trigger. My developer console page is also not opening. It keeps loading and the page crashes. :( :(
    Can anyone help ? I am not able to write the trigger.

    Thanks

    ReplyDelete
  18. Hi,
    Same problem- I am not able to find the object "BatchApexErrorEvent" in Objects..
    Did u get anything?

    ReplyDelete
  19. Verify your playground App and the app attached with your Trail-head. I know i'm replying late so sorry.

    ReplyDelete
  20. This comment has been removed by the author.

    ReplyDelete
  21. I got passed in the Platform Developer I (WI20) (PDI) exam recently. I am here to share my experiences and study resources related to this exam.
    There are many free and paid study resources on the internet to help you practice and pass the Platform Developer I (WI20) exam.
    few resources that I personally used to prepare myself is valid practice material like up-to-date PDI exam training questions, reading community reviews and discussions regarding exam experience of different candidates will be helpful.
    https://www.dumpsforsales.com/product/PDI-dumps-pdf/

    ReplyDelete

Post a Comment

Popular posts from this blog

Platform Developer I Certification Maintenance (Winter '23)

 Maintain Your Platform Developer I Certification for Winter ’23 1. Field update actions have changed in API Version 54.0. Which record-triggered flows do field update actions now execute? Answer: Before-Save after After-Save 2. Which Apex class is used to determine the hostnames for the domains that Salesforce hosts for your org? Answer: System.DomainCreator 3. Which modules can be used for notifications in a Lightning web component instead of native APIs? Answer: LightningAlert, LightningConfirm, and LightningPrompt 4. What determines an org’s “shape” in Salesforce? Answer: Features, settings, edition, limits, and licenses 5. Which lightning-modal-* component is required to create a modal? Answer: Body 6. How do you call an invocable action from Apex code? Answer: Reference Invocable.Action Get Hands-On With Apex Assertions 1. Create Two Apex class: Copy and Paste below codes (A.) TestFactory @isTest public class TestFactory {    public static Account getAccount(String accountName, B

Administrator Certification Maintenance (Spring '23)

 Maintain Your Administrator Certification for Spring '23 1. What information is listed in the Details panel for recently used reports? Answer: A, B, C 2. What is used to give sales reps access to a guided process to import contacts and leads? Answer:  Sample CSV file 3. Which feature efficiently removes inactive picklist values? Answer: Bulk Delete Unused Values 4. Which type of Process Builder processes can be converted using the Migrate to Flow tool? Answer: Record-triggered Get Hands-on with Enhance Record Pages With Dynamic Forms Follow steps show in Screenshot also highlighted with Red Box:

Platform App Builder Certification Maintenance (Winter ’23)

Maintain Your Platform App Builder Certification for Winter ’23 1. What component customizes related lists directly from the Lightning App Builder? Answer:      Dynamic Related List – Single 2. Where can a debug flow test be created and saved? Answer:      Flow Builder 3. What action enables smart email auto-responses in Flow Builder? Answer:      Create Article Recommendations 4. Custom address fields improve address data accuracy for your users using what type of list? Answer: State and Country/Territory Picklists 5. What are the benefits of using Dynamic Forms on record pages? Answer:      Place fields anywhere on the page  Use Visibility Rule to show and hide fields  6. Restriction or scoping rules now allow multiple values. When should double quotes surround a value? Answer:      If a single value contains a comma  Get Hands-On With Permission Set Expiration Verify before performing this: Permission Set & Permission Set Group Assignments with Expiration Dates should be enabled

Translate