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

Maintain Your Platform Developer I Certification for Winter ’25

  Make Invocable Actions Easier to Configure with New InvocableVariable Modifiers Simplify the configuration of invocable actions using new modifiers from Salesforce. Both the defaultValue and placeholderText modifiers will appear in Flow Builder for the Action elements that correspond to an invocable method. Here’s how to use them. defaultValue Modifier : Set a default value for an input parameter. When the action is used, the input parameter will have a predefined value unless changed by the user. placeholderText Modifier : Set custom placeholder text for an input parameter. Text can provide examples or additional guidance to help users understand what to enter in the input field. Accessing these modifiers in Flow Builder makes it easier to configure and use the actions within your flows. This change applies to Lightning Experience and Salesforce Classic in Performance, Unlimited, Developer, Enterprise, and Database.com editions.

Maintain Your Administrator Certification for Spring ’24

Maintain Your Administrator Certification for Spring ’24 Intelligence Views Intelligence views are now available for leads, contacts, and accounts in Sales Cloud. Turn on a view in Setup and then add the Intelligence View button to the view-button layout for the applicable page. New Salesforce organizations include the views by default, but admins for existing orgs can enable: Lead Intelligence View Contact Intelligence View Account Intelligence View Find specifics about these views in the next three topics. Turn on Contact Intelligence View in Contact Intelligence View Setup and add the Intelligence View button to the Contact List View button layout. To view engagement metrics, enable Email Tracking in the Inbox section of Sales Engagement Setup. To see the Intelligence View, users go to the Contact home page and click Intelligence View. To view engagement metrics, choose Engagement Metrics from the Metrics menu. To see the Account Intelligence view, go to the account home page and cl...

Maintain Your Administrator Certification for Spring ’25

  Manage Included Permission Sets in Permission Set Groups via Summaries Update user access more efficiently by specifying which permission set groups include a permission set directly from the permission set’s summary. Previously, to manage included permission sets, you were required to navigate to each permission set group’s page. From Setup, in the Quick Find box, enter  Permission Sets , and select Permission Sets. Select a permission set, and then click  View Summary . In the Related Permission Set Groups tab, click  Add  or  Remove . This change applies to Lightning Experience and Salesforce Classic (not available in all orgs) in Contact Manager, Group, Essentials, Professional, Enterprise, Performance, Unlimited, Developer, and Database.com editions. Sort List Views by Multiple Columns To see your data in a more intuitive way and make your list views more actionable, you can now sort list views on object home pages by up to five columns. Select the c...

Translate