Saturday 26 December 2020

Platform Developer I Certification Maintenance (Winter '21)

 How can a suspended event be resumed where it left off, to avoid missing any events that were published during the suspension?

  1. Refresh the Event
  2. Resume the Event
  3. Resume the Event from New 
  4. Resume the Event from Tip
Answer: Resume the Event

Which statement is true regarding events configured with the Publish Immediately behavior?

  1. Publish immediately Events count towards Apex DML limits
  2. EventBus.publish() returns how many platform events are configured to publish immediately.
  3. The events are published and do not depend on the successful completion of the transaction.
  4. Events published immediately prevent Apex callout from being performed after publishing.

Answer: The events are published and do not depend on the successful completion of the transaction.

What is the minimum code coverage requirement in order to promote and release an unlocked package?

  1. 70%
  2. 75%
  3. 85%
  4. 90%

Answer: 75%

When using WITH SECURITY_ENFORCED in a SELECT clause, what happens if a field referenced in the clause is inaccessible to the user?

  1. The query succeeds, but no data returned.
  2. The query succeeds, and null data set is returned.
  3. The query fails with an error indicating no access allowed.
  4. The query throws an exception indicating insufficient permission and no data is returned.

Answer: The query throws an exception indicating insufficient permission and no data is returned.

A developer wants to send a custom notification when an important event occurs. What can the developer use?

  1. Messaging.Custom Notification Class
  2. Messaging.Push Notification Class
  3. Messaging.Notification Action Class
  4. Messaging.Send Notification Class

Answer: Messaging.Custom Notification Class

A developer wants to check whether a user has a standard permission. Where should the developer import Salesforce permissions from in order to check this?

  1. @salesforce/hasPermission
  2. @salesforce/customPermission
  3. @salesforce/userPermission
  4. @salesforce/customPermission/namespace

Answer: @salesforce/userPermission

When does Salesforce plan to enforce the removal of instance names from all Visualforce URLs?
Answer: Summer 22
What is a current use case for incorporating the @track decorator in a field of a Lightning web component?
Answer: To observe changes when the field contains an array

What is the default behavior of the Lightning message service scope parameter?

  1. Active area Only
  2. Entire application
  3. Publisher message channel
  4. Active area and all hidden tabs

Answer: Active area only

HandsOn 


Updated Code of class

@RestResource(urlMapping='/apexSecurityRest')
global with sharing class ApexSecurityRest {
    @HttpGet
    global static Contact doGet() {
        Contact result;
         Id recordId = RestContext.request.params.get('id');
    
          List<Contact> results = [SELECT id, Name, Title, Top_Secret__c, Account.Name FROM Contact WHERE Id = :recordId];
          SObjectAccessDecision securityDecision = Security.stripInaccessible(AccessType.READABLE, results);
          
           SObjectAccessDecision securityDecision2 =
       Security.stripInaccessible(AccessType.UPDATABLE,
             [SELECT Description FROM Contact]
             );
             result.Description = result.Account?.Name;

           return result;
      }
      public class FunctionalException extends Exception{}
      public class SecurityException extends Exception{}
}

1 comment: