Saturday 26 December 2020

Platform App Builder Certification Maintenance (Winter '21)

 Where should an app builder go to analyze performance on a Lightning record page?

  1. Lightning App Manager
  2. Lightning Object Manager
  3. Lightning App Launcher
  4. Lightning App Builder

Answer : Lightning App Builder

What field is updated when deploying sharing settings simultaneously?

  1. Sharing Criteria Rules
  2. Sharing Models
  3. Criteria Items
  4. Owner Rules
Answer: Sharing Models

What should an app builder use to build a collection of records for three different custom objects?

  1. Use a reusable screen Component
  2. Create a custom Component
  3. Clone a Screen Component
  4. Use Loop Component

Answer: Use a reusable screen Component

An app builder received feedback that a custom page layout has too many fields on it, and some fields are only needed if other fields are entered. What should an app builder configure to help with this issue?

  1. Dependent picklist
  2. Lightning Web Component
  3. Dynamic Forms
  4. Separate page layouts & record types
Answer: Dynamic Forms

What type of flow is available for an app builder to debug as another user?

  1. Invocable process
  2. Screen Flows
  3. Platform Events
  4. Record Change Process
Answer: Screen Flows


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{}
}

Thursday 24 December 2020

Salesforce - Sending Surveys to Customer using Salesforce Survey

 Salesforce Survey

In order to use salesforce surveys, org must have salesforce surveys enabled. Salesforce gives us previlage to send surveys to employees and to user outside of company. In this post I will explain how we can send surveys to contacts outside of company without using code.

In order to achieve this we will use following things
  1. Salesforce Surveys
  2. Community
  3. Flow
  4. Email template
  5. Process Builder

Survey

Make sure your salesforce org has lightning turned on as salesforce survey object is accessible in lightning only. In order to access salesforce survey tab you can access it from both lightning and classic.
 Go in setup search and write down survey. Click on survey settings and make sure you turned on survey from here. Later in this post we will create a community to select here.
Now select salesforce survey from lightning tabs and click new and create a survey. Select name as surveys for customers. Add some text on survey welcome page. Something like that

At Universal Container we are committed to providing our customers the best technical support and service. Please take this brief two-minute survey about your recent contact with our Technical Support Staff.

Add next page and click on page and click on Add Question button and select NPS to add on your page. Enter below text as question




How likely are you to recommend our service to a friend or colleague?

Add below text on thank you page

Thank you for taking the survey. Your feedback is important to us

Click save and then click activate button. If you want to update this survey you have to create a separate version.

Survey Invitation

Go in survey invitation object and create a custom field email. This field will be used to send surveys to emails.

Community

Now we will create a community which will be used as a bridge to send surveys to contacts outside of our company.
Go in setup search and write all communities. Click on All communities and then create a community by clicking button new community.
Select build your own and then click Get Started. Enter name "Survey" and url survey and click create.

It will take few minutes for system to create your community.
Now go back into survey settings and select this community 

Flow

In order to launch surveys automatically we will be using lightning flows. When a case is closed we will automatically launch a flow. Go in the setup search and write down flow. Click on flows under process automation heading. Click new flow button and select record triggered flow.

Now select when record is updated then select objects is case and then put condition status equal to closed.
Now drag get records to get community information. We need community information create survey invitation data.
Add condition community name = survey
Now use get records to get survey record id.

Drag create record and now create a record for survey invitation object with below mapping

community id = community id
Survey id = survey id
Email = Contact email
Allow guest user response = true
Invitation name = test




Now add an action. select email send. Add email alert name and select survey invitation record id in related record id option.

In order to make sure you only send one survey per case update case with the check box survey send = true in the end of flow.
Now activate your flow.

Publishing Community

Now go back into setup and select all communities and then click builder in front of your community name.
Click on components and type survey in search box. drag and drop survey component on front page and then select your survey on it.
Now go in community profile and make sure that community profile have cru right on survey, survey invitation and survey response object.
Now mark your community as public and then publish it.



Email Template

Create an email template with below wording and create take survey link like this
Community Url/runtimeApp.app?invitationId={!SurveyInvitation.Id}&surveyName={!SurveyInvitation.Name}&UUID={!SurveyInvitation.UUID}


Process Builder


In order to stop contacts filling survey multiple times you can create a process builder on survey invitation object. Select when record is created or updated.
In condition select status ischanged = true and status = completed in action use immediate action and mark allow guest response to false.