• TrailheadBeginner
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
function selectAllCheckboxes(obj,receivedInputID)
        {
            var inputCheckBox = document.getElementsByTagName("input");         //we are taking tage name here         
             for(var i=0; i<inputCheckBox.length; i++)
            {          
                 
                if(inputCheckBox[i].id.indexOf(receivedInputID)!=-1)
                {                                     
                   
                    inputCheckBox[i].checked = obj.checked;
                }
            }
        }
        
        ==============================================================
         <apex:column >
                <apex:facet name="header">
                     <apex:inputCheckbox onclick="selectAllCheckboxes(this,'inputId')"/>
                </apex:facet>
                
                <apex:inputCheckbox value="{!a.isSelected}" id="inputId"/>                                   
            </apex:column>
            ===============================================================
1) A developer created a Visualforce page that has a custom controller that navigates to an external website after the'
command button is pressed. What is the recommended way to test this functionality? 
A. Use .getURL() on the result of the action method and System.assertEquals () to compare the resulting URL.
B. ‘ Use ApexPages.currentPage () .getUrl () and System.assertElquals () to compare the end URL.
C. ‘ Use Test.getCurrentPage() .getUrl () and System.assertEquals () to compare the end URL.
D. Test the navigation by executing the use case through the browser and manually inspecting the resulting URL.

2) What is the output of the following code snippet?
Contact con = new Contact( LastName = 'JOHNSON', LeadSource = 'Web')
Savepoint sp = Database.setSavepoint();
insert con;
Database.rollback(sp);
con.LeadSource = 'Email'
insert con;
Error is at line 6(last) - > Can not specify id in an insert call
A. A runtime error will be thrown on line 5.
B. The contact record will be inserted with Leadsource value Web.
C. A runtime error will be thrown on line 8.
D. The contact record will be inserted with Leadsource value Email.

3) A company has 20,000 rows in the Account object and 2 million rows in the Sales_Data_c object that is related to Account. All
of the records in the Sales_Data_c object have a field that contains the string 'Le.‘ Which statement will throw a "Too many query
rows" exception? Choose 2 answers 
A. List<List<SObject>> result= [FIND 'Le' IN ALL FIELDS RETURNING Sales_Data_c(Id)];
B. List<Account> result = [SELECT Id, (SELECT Id FROM Sales_Data_r) FROM Account]
C. List<sObject> result = Database.query('SELECT Id FROM Sales_Data_c LIMIT 50000');
D, List<AggregateResult> result = [SELECT count(Id) total FROM Sales_Data_c];

4) What is the output of the following code snippet?
Contact con = new Contact( LastName = 'Smith', Department = 'Admin')
insert con;
Savepoint sp_finance = Database.set5avepoint();
con.Department = 'finance';
update con;
SavepOLnt sp_hr = Database.set5avepo1nt();
con.Department = 'HR';
update con;
Database.rollback(3p_flnance);
Database.rollback(3p_hr); = Error
A. The contact record will be saved ME department value HR.
B. A runtime error will be thrown on line 12.
C. A runtime error will be thrown on line 13.
D. The contact record will be saved with department value Finance

5) What is a limitation of compound fields? 
A. Are read-only unless accessed by Location and Address Apex classes.
B. Can only be updated through individual field components.
C. Are read-only when accessed through Visualforce pages.
D. Cannot be queried through the use of Apex classes.

6) A developer has created a solution using the SOAP API for authenticating Communities users. What is needed when issuing
the login()Call? Choose 2 answers 
A. Organization Id
B. Security Token
C. Session Id
D. Username and Password

7) Given the following code sample, what is a potential issue regarding bulk processing of records?
trigger accountTestTrggr on Account (before insert, before update)
Account acct = Trigger.new[0];
List <Contact> contacts = new List <Contact> ([select id, salutation, firstname, lastname,
email from Contact where accountId = :acct.Id]);
for (Contact con: contacts)
con.Title = 'Not Selected';
update contacts; 
A. The code will not execute because the record in the list can be null and cause an exception.
B. The code will process one record that is called explicitly per execution.
C. The code will not execute because the list can be null and cause an exception.
D. The code will have to be invoked multiple times to process all the records.

8) A company requires that a child custom record is created when an Order record is inserted. The company's administrator
must be able to make changes to the solution.
What is the recommended solution for implementing this requirement? 
A. Create a Visual Workflow that will create the custom child record when the Order is inserted.
B. Create a Force.com Workflow Rule to create the custom child record when the Order is inserted.
C. Create an Apex Trigger to create the custom child record when the Order is inserted.
D. Create a Lightning Process to create the custom child record when the Order is inserted

9) What is a best practice when unit testing a controller? Choose 2 answers 
A. Simulate user interaction by leveraging Test.setMock().
B. Verify correct page references by using getURL()
C. Access test data by using seeAllData=true.
D. Set query parameters by using getParameters () .put

10) What is a consideration when testing batch Apex? 
Choose 2 answers
A. Test methods must execute the batch with a scope size of less than 200 records.
B. Test methods must call the batch execute () method once.
C. Test methods must use the @isTest (SeeAllData=true) annotation.
D. Test methods must run the batch between Test. startTest () and Test.stopTest

11) Which statement is true about using ConnectApi namespace (also called Chatter in Apex)?
Choose 2 answers 
A. Chatter in Apex methods honor the 'with sharing' and 'without sharing' keywords.
B. Chatter in Apex operations are synchronous, and they occur immediately.
C. Chatter in Apex methods do not run in system mode; they run in the context of the current user.
D. Many test methods related to Chatter in Apex require the BIsTest (SeeAllData=true) annotation.

12) A developer is writing unit tests for the following method:
public static Boolean isFreezing(String celsiusTemp)
if(String.isNotBlank(celsiusTemp) && celsiusTemp.isNumeric())
return Decimal.valueof(celsiusTemp) <= 0;
return null;
Which assertion would be used in a negative test case? 
A_System.assertEquals(true, isFreezing(null));
B. System. assertEquals (true, isFreezing( ' 0’);
C System.assertEquals(null, isFreezing('asdf'));
D.System.assertEquals(true, isFreezing('lOO'));

13) A company wants to create a dynamic survey that navigates users through a different series of questions based on
their previous responses.
What is the recommended solution to meet this requirement? 
A. Dynamic Record Choice
B. Lightning Process Builder
C. Visualforce and Apex
D. Custom Lightning application

14) Which statement is true regarding both Flow and Lightning Process?
A. Can use Apex methods with the @InvocableMethod annotation.
B. Are both server-side considerations in the Order of Execution.
C. Can use Apex that implements the Process. Plugin interface.
D. Are able to be embedded directly into Visualforce pages.

15) A developer writes the following code:
public with sharing class OrderController
public PaqeReference sendOrder()
Order__c order = new Order__c
insert order;
ExternalOrder externalOrder = new ExternalOrder(order);
Http h = new Http();
HttpRequest req = new HttpRequest();
req.setEndpoint('https://www.example.org/v1/orders');
req.setMethod('POST');
req.setBody(JSON.serialize(externalOrder));
HttpResponse res = h.send(req);
order = (ExternalOrder)JSON.deserialize(res.getBody(), ExternalOrder.class);
While testing the code, the developer receives the followmg error message:
System.CalloutException : You have uncommitted work pending
What should the developer do? 
Choose 2 answers
A. Use the asyncSend() method of the HTTP class to send the request in async context.
B. Ensure all callouts are completed prior to executing DML statements.
C. Move the web service callout into an @future method.
D. Use Database.insert (order, true) to immediately commit any database changes.
function selectAllCheckboxes(obj,receivedInputID)
        {
            var inputCheckBox = document.getElementsByTagName("input");         //we are taking tage name here         
             for(var i=0; i<inputCheckBox.length; i++)
            {          
                 
                if(inputCheckBox[i].id.indexOf(receivedInputID)!=-1)
                {                                     
                   
                    inputCheckBox[i].checked = obj.checked;
                }
            }
        }
        
        ==============================================================
         <apex:column >
                <apex:facet name="header">
                     <apex:inputCheckbox onclick="selectAllCheckboxes(this,'inputId')"/>
                </apex:facet>
                
                <apex:inputCheckbox value="{!a.isSelected}" id="inputId"/>                                   
            </apex:column>
            ===============================================================