• kumquatlily
  • NEWBIE
  • 15 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
Appreciate the correct answers for the following PD 1 exam questions and clarification?
My thoughts of answers in Italic.
thanks in advance!

1.  Given the following Anonymous Block:
List<Case> casesToUpdate = new List<Case>();
for(Case thisCase : [Select Id, Status FROM Case LIMIT 50000]){            thisCase.status = 'Working';
    casesToUpdate.add(thisCase);

} try{
       Database.update(casesToUpdate.false);
}catch(Exception e){
      System.debug(e.getMessage()); }

What should a developer consider for an environment that has over 10,000 Case records?
A. The transaction will fail due to exceeding the governor limit.  
B. The try/catch block will handle any DML exceptions thrown.
C. The transaction will succeed and changes will be committed.
D. The try/catch block will handle exceptions thrown by governor limits.

2. A developer has an Apex controller for a Visualforce page that takes an ID as a URL parameter. How should the developer prevent a cross site scripting vulnerability?
A. ApexPages.currentPage() .getparameters() .get('url_param')
B. ApexPages.currentPage() .getParameters() .get('url_param') .escapeHtml4()
C. String.ValueOf(ApexPages.currentPage() .getparameters() .get('url_param'))
D. String.escapeSingleQuotes(ApexPages.currentpages() .getParameters() .get('url_param'))
Hi, 

My problem - a few of the custom lightning web components in my sandbox org, I can enable them to my sandbox org community builder.  However, the rest of custom lighning web components that I need in community builder, I cannot enable to community builder. 

Question - A) is it required to add isExposed = true and lightningCommunity__Page in Target to custom lightning web component for enabling to Community Builder? 
Or
B) just add forceCommunity:availableForAllPageTypes and access="global" to the custom web component?
Much appreciate your advise which of these two methods should I be using A or B? 
If A - where should I add isExposed = true and lightningCommunity__Page in Target?  in Component or in SVG within Developer Console?  and do I need to addother Target besides lightningCommunity_Page?
If B - do I need to add access="global" to all aura:attribute name as well as all aura:attribute handler too?

What I did - to a custom web component from an app that downloaded from appExchange, I added forceCommunity:availableForAllPageTypes and access="global" to 'implements' and all the attribute name, it works, I see in my Sandbox Community Builder, see below:
Other custom web components from the same app, is not coming up in Sandbox Community Builder components...  

<aura:component controller="PropertyController"
                implements="flexipage:availableForAllPageTypes,forceCommunity:availableForAllPageTypes" access="global">
    
    <aura:attribute name="properties" type="Property__c[]" access="global"/>
    <aura:attribute name="pageSize" type="integer" default="8" access="global"/>
    <aura:attribute name="page" type="integer" access="global"/>
    <aura:attribute name="pages" type="integer" access="global"/>
    <aura:attribute name="total" type="integer" access="global"/>

    <aura:attribute name="searchKey" type="String" default="" access="global"/>
    <aura:attribute name="minPrice" type="integer" default="0" access="global"/>
    <aura:attribute name="maxPrice" type="integer" default="10000000" access="global"/>
    
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    <aura:handler event="c:RangeChange" action="{!c.onRangeChange}"/>
    <aura:handler event="c:EinsteinVisionEvent" action="{!c.onEinsteinVisionEvent}"/>

    <lightning:layout horizontalAlign="center" multipleRows="true">
        <aura:iteration items="{!v.properties}" var="property">
            <lightning:layoutItem padding="around-small" size="12" smallDeviceSize="6" mediumDeviceSize="4" largeDeviceSize="3">
                <c:PropertyTile property="{#property}"/>
            </lightning:layoutItem>    
        </aura:iteration>
    </lightning:layout>
    <c:PropertyPaginator page="{!v.page}" pages="{!v.pages}" total="{!v.total}"
                         pagePrevious="{!c.onPagePrevious}" pageNext="{!c.onPageNext}"/>
    
</aura:component>
 
Appreciate the correct answers for the following PD 1 exam questions and clarification?
My thoughts of answers in Italic.
thanks in advance!

1.  Given the following Anonymous Block:
List<Case> casesToUpdate = new List<Case>();
for(Case thisCase : [Select Id, Status FROM Case LIMIT 50000]){            thisCase.status = 'Working';
    casesToUpdate.add(thisCase);

} try{
       Database.update(casesToUpdate.false);
}catch(Exception e){
      System.debug(e.getMessage()); }

What should a developer consider for an environment that has over 10,000 Case records?
A. The transaction will fail due to exceeding the governor limit.  
B. The try/catch block will handle any DML exceptions thrown.
C. The transaction will succeed and changes will be committed.
D. The try/catch block will handle exceptions thrown by governor limits.

2. A developer has an Apex controller for a Visualforce page that takes an ID as a URL parameter. How should the developer prevent a cross site scripting vulnerability?
A. ApexPages.currentPage() .getparameters() .get('url_param')
B. ApexPages.currentPage() .getParameters() .get('url_param') .escapeHtml4()
C. String.ValueOf(ApexPages.currentPage() .getparameters() .get('url_param'))
D. String.escapeSingleQuotes(ApexPages.currentpages() .getParameters() .get('url_param'))
Appreciate the correct answers for the following PD 1 exam questions and clarification?
My thoughts of answers in Italic.
thanks in advance!

1.  Given the following Anonymous Block:
List<Case> casesToUpdate = new List<Case>();
for(Case thisCase : [Select Id, Status FROM Case LIMIT 50000]){            thisCase.status = 'Working';
    casesToUpdate.add(thisCase);

} try{
       Database.update(casesToUpdate.false);
}catch(Exception e){
      System.debug(e.getMessage()); }

What should a developer consider for an environment that has over 10,000 Case records?
A. The transaction will fail due to exceeding the governor limit.  
B. The try/catch block will handle any DML exceptions thrown.
C. The transaction will succeed and changes will be committed.
D. The try/catch block will handle exceptions thrown by governor limits.

2. A developer has an Apex controller for a Visualforce page that takes an ID as a URL parameter. How should the developer prevent a cross site scripting vulnerability?
A. ApexPages.currentPage() .getparameters() .get('url_param')
B. ApexPages.currentPage() .getParameters() .get('url_param') .escapeHtml4()
C. String.ValueOf(ApexPages.currentPage() .getparameters() .get('url_param'))
D. String.escapeSingleQuotes(ApexPages.currentpages() .getParameters() .get('url_param'))