Wednesday 1 December 2021

Salesforce Certified Platform Developer1 (winter 21)

STEP1

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

A. Resume the event

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

A. the events are published and do not depend on the successful completion of the transaction

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

A. 75%

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

A. the query throws an exception indicating unsufficient permissions and no data is returened

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

A. Messaging.customNotification class

STEP2

1.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?

A.@salesforce/userPermission

2.When does Salesforce plan to enforce the removal of instance names from all Visualforce URLs?

A. summer 22

3.What is a current use case for incorporating the @track decorator in a field of a Lightning web component?

A.to observe changes when the field contains an array

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

A.Active area only


STEP3


1. ObjectManager--->contacts-->new custom field

Field Label: Top Secret

Type: Text

Field Name: Top_Secret

Length: 255

2.Uncheck the Visible box for the Standard User profile


ApexclassName: ApexSecurityRest


@RestResource(urlMapping='/apexSecurityRest')

global with sharing class ApexSecurityRest {

    @HttpGet

    global static Contact doGet() {

        Id recordId = RestContext.request.params.get('id');

        Contact result;

        if (recordId == null) {

           throw new FunctionalException('Id parameter is required');

        }

        List<Contact> results = [SELECT id, Name, Title, Top_Secret__c, Account.Name FROM Contact WHERE Id = :recordId];

            SObjectAccessDecision securityDecision =

       Security.stripInaccessible(AccessType.READABLE, results);

          if (!results.isEmpty()) {

             result = results[0];

                result.Description = result?.Account?.Name;

              }

             return result;

      }

      public class FunctionalException extends Exception{}

      public class SecurityException extends Exception{}

}