Tuesday, January 1, 2019

Platform Developer I Certification Maintenance (Winter '19)



Platform Developer I Certification Maintenance (Winter '19)





→ Understand New and Updated Apex Methods, Exceptions, and Interfaces


1. Which method of the DescribeSObjectResult class allows you to access record types by their developer name?
A. getRecordTypeInfos()
B. getRecordTypeInfosById()
C. getRecordTypeInfosByName()
D. getRecordTypeInfosByDeveloperName()

2. Which Apex class includes new methods to verify digital and HMAC signatures?
A. System.Auth
B. System.Crypto
C. System.Approval
D. Schema.Signature

→ Learn What's New for Platform Developers


1. Your org has My Domain enabled. What is the most efficient method to obtain a valid session ID to make an HTTP callout from asynchronous Apex code to Salesforce APIs?
A. Use a Named Credential.
B. Use System.UserInfo.getSessionId().
C. Set the endpoint to URL.getOrgDomainUrl()
D. Session IDs are no longer required when My Domain is enabled.

2. Which annotation allows a developer to make the result of an Apex method storable for Lightning components?
A. @AuraStorable
B. @AuraCacheable
C. @AuraEnabled(storable=true)
D. @AuraEnabled(cacheable=true)

3. Which merge field allows you to isolate untrusted third-party content with <apex:iframe> tag in Visualforce?
A. $Resource
B. $SecureResource
C. $IFrameResource
D. $Page.IFrameResource

4. Prior to installing an unlocked package, which object should a developer query using the Tooling API to list the packages it depends on?
A. InstalledPackage
B. PackageDependency
C. UnlockedPackageInfo
D. SubscriberPackageVersion

→ Work with the Lightning Map Component and Apex Inherited Sharing


Launch the org you’ll use for the hands-on challenge, then create the following custom object and two custom fields.

• Create a custom object that will be used to store information about the various towers in the western States that are owned by Out and About Communications.
  ○ Label: Tower
  ○ Plural Label: Towers

• Create a new custom field to establish a Master-Detail relationship between Tower and Account. Add the Towers related list to the Account page layout.
  ○ Field Label: State
  ○ Type: Master-Detail
  ○ Field Name: State
  ○ Child Relationship Name: Towers

• Create a new custom field to enter the latitude and longitude for the location of each Tower.
  ○ Field Label: Tower Location
  ○ Field Name: Tower_Location
  ○ Type: Geolocation
  ○ Latitude and Longitude Display Notation: Decimal
  ○ Decimal Places: 6

Now add some data.

• Create two new Account records to represent the regions (only the Name field is required).
  ○ Utah
  ○ Idaho

• Create four new Tower records
  ○ Name: Lightning Ridge
  ○ State: Utah
  ○ Latitude: 40.490684
  ○ Longitude: -110.908727

  ○ Name: Craters
  ○ State: Idaho
  ○ Latitude: 43.555375
  ○ Longitude: -113.70069

  ○ Name: Nuckols
  ○ State: Idaho
  ○ Latitude: 47.516694
  ○ Longitude: -115.939163

  ○ Name: Rainbow
  ○ State: Utah
  ○ Latitude: 37.060663
  ○ Longitude: -110.975708

You use the code blocks below to complete the challenge.


TowerMapUtilClass code block:
public  inherited sharing class TowerMapUtilClass {
     public static List<sObject> queryObjects(String theObject, List<String> theFields, String theFilter, String sortField, String sortOrder) {
          String theQuery = 'SELECT ' + string.join(theFields, ',');
          theQuery += ' FROM ' + theObject;
          if(!String.isEmpty(theFilter)) {
               theQuery += ' WHERE ' + theFilter;
          }
          if(!String.isEmpty(sortField)) {
               theQuery += ' ORDER BY ' + sortField;
               if(!String.isEmpty(sortOrder)) {
                    theQuery += ' ' + sortOrder;
               }
          }
          return database.query(theQuery);
     }
}

TowerMapControllerClass code block:
public with sharing class TowerMapControllerClass {
     @AuraEnabled
     public static List<Tower__c> getAllTowers() {
          String theObject = 'Tower__c';
          List<String> theFields = new List<String>{'Id', 'Name', 'State__r.Name', 'Tower_Location__Latitude__s', 'Tower_Location__Longitude__s'};
          String theFilter = '';
          String sortField = 'Name';
          String sortOrder = 'ASC';
          List<Tower__c> allTowers = TowerMapUtilClass.queryObjects(theObject, theFields, theFilter, sortField, sortOrder);
          return allTowers;
     }
}

Towermap Lightning component code block:
<aura:component implements="flexipage:availableForAllPageTypes" controller="TowerMapControllerClass" access="global" >
     <aura:attribute name="mapMarkers" type="Object" access="PRIVATE" />
     <aura:attribute name="markersTitle" type="String" access="PRIVATE" />
     <aura:handler name="init" value="{!this}" action="{!c.handleInit}"/>
     <aura:if isTrue="{!!empty(v.mapMarkers)}" >
          <lightning:map mapMarkers="{!v.mapMarkers}" zoomLevel="5" markersTitle="{!v.markersTitle}"/>
     </aura:if>
</aura:component>

Controller code block:
({
     handleInit: function (component, event, helper) {
          helper.initHelper(component, event, helper);
     }
})

Helper code block:
({
     initHelper : function(component, event, helper) {
          helper.utilSetMarkers(component, event, helper);
     },
     utilSetMarkers : function(component, event, helper) {
          let action = component.get("c.getAllTowers");
          action.setCallback(this, function(response) {
               const data = response.getReturnValue();
               const dataSize = data.length;
               let markers = [];
               for(let i=0; i < dataSize; i += 1) {
                    const Tower = data[i];
                    markers.push({
                        'location': {
                             'Latitude' : Tower.Tower_Location__Latitude__s,
                             'Longitude' : Tower.Tower_Location__Longitude__s
                        },
                        'icon': 'utility:Tower',
                        'title' : Tower.Name,
                        'description' : Tower.Name + ' Tower Location at ' + Tower.State__r.Name
                   });
               }
               component.set('v.markersTitle', 'Out and About Communications Tower Locations');
               component.set('v.mapMarkers', markers);
          });
          $A.enqueueAction(action);
     }
})

16 comments:

  1. Wow that was odd. I just wrote an very long comment but after I clicked submit
    my comment didn't appear. Grrrr... well I'm not writing all that over again. Anyhow,
    just wanted to say great blog!

    ReplyDelete
  2. This design is steller! You obviously know how to keep a reader entertained.
    Between your wit and your videos, I was almost moved to start my own blog (well, almost...HaHa!) Wonderful job.
    I really enjoyed what you had to say, and more than that, how you presented it.

    Too cool!

    ReplyDelete
  3. Towermap Lightning component code block:








    ReplyDelete
  4. Very good article. I will be facing some of these issues as
    well..

    ReplyDelete
  5. Aw, thbis was a really nice post. Taking a few minutes and
    actual effort to generate a superb article… but what can I say… I hesitate a whole lott and never manage to get nearly anything done.

    ReplyDelete
  6. For most recent news you have to go to see internet and on world-wide-web I found this web
    site as a finest web page for most recent updates.

    ReplyDelete
  7. I was wondering if you ever thought of changing the layout of your blog?
    Its very well written; I love what youve got to say. But maybe you could a
    little more in the way of content so people could connect with it better.
    Youve got an awful lot of text for only having 1 or
    two pictures. Maybe you could space it out better?

    ReplyDelete
  8. I'm not sure why but this blog is loading incredibly slow for me.
    Is anyone else having this problem or is it a
    issue on my end? I'll check back later and see if the problem still exists.

    ReplyDelete
  9. Very good post! We will be linking to this great post
    on our website. Keep up the good writing.

    ReplyDelete
  10. Hurrah, that's ԝhat I was lookikng for, what a stuff!
    existіng hesrе att this webpage, thanks admin off this web page.

    ReplyDelete
  11. For newest information you have to go to see web and on web I found this website as
    a finest web site for newest updates.

    ReplyDelete
  12. Hi there, I enjoy reading through your article.
    I wanted to write a little comment to support you.

    ReplyDelete
  13. Ahaa, its fastidious dialogue regarding this
    post at this place at this web site, I have read all
    that, so at this time me also commenting here.

    ReplyDelete
  14. Attractive section of content. I just stumbled upon your website
    and in accession capital to assert that I get in fact enjoyed account your blog posts.

    Any way I'll be subscribing to your augment and even I achievement you access consistently rapidly.

    ReplyDelete
  15. magnificent points altogether, you simply won a new reader.
    What may you suggest about your submit that you just made some days ago?
    Any certain?

    ReplyDelete
  16. I'm gone to inform my little brother, that he should also pay
    a quick visit this website on regular basis to take updated from most up-to-date gossip.

    ReplyDelete