• Ritika Singh
  • NEWBIE
  • 60 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 5
    Replies
There's an custom object "Student" and 
Field 1 :  Subject
Field 2  :  Branch
Current Scenario - Subject = Maths, Social, English, Arts
Branch(Multi picklist)  - Science , Humanities, Commerce

Requirement :
Given : Subject - Maths & Branch - Humanities
TODO : For all picklist field with value Branch = Humanities,
 Change Field value of Subject from Maths to English for all existing records in object.

What is the best possible way to achieve this by configuration ?
Universal Containers recently transitioned from Classic to Lighting Experience. One of its business processes requires certain value from the opportunity object to be sent via HTTP RESTcallout to its external order management system based on a user-initiated action on the opportunitypage. Example values are as follow* Name* Amount* AccountWhich two methods should the developer implement to fulfill the business requirement?
(Choose 2answers)

A. Create a Process Builder on the Opportunity object that executes an Apex immediate action toperform the HTTP REST callout whenever the Opportunity is updated.

B. Create a Visualforce page that performs the HTTP REST callout, and use a Visualforce quick actionto expose the component on the Opportunity detail page.

C. Create an after update trigger on the Opportunity object that calls a helper method using@Future(Callout=true) to perform the HTTP REST callout.

D. Create a Lightning component that performs the HTTP REST callout, and use a Lightning Action toexpose the component on the Opportunity detail page
How does the lightning component framework help developers implement solutions faster ? Which one is correct ?

A. By providing an Agile process with default steps
B. By providing change history and version conrol
C. By providing device awareness for mobile and desktops
D. By providing code review standards and processes
The initial value for a number field on a record is 1. A user updated the value of the number field to 10. This action invokes a workflow field update, which changes the value of the number field to 11. After the workflow field update, an update trigger fires.
What is the value of the number field of the object that is obtained from Trigger.old?

A. Null

B. 11 (Since 11 will be the immediate previous value before update, so i am considering it correct)

C. 1

D. 10

 Is it 11 or 1 ? And How ?
Which three are valid controller options for the following page? A developer is asked to create a custom visualforce page that will be used as a dashboard component.

A. Use a custom controller
B. Use a custom controller with extensions
C. Use a standard controller with extensions
D. Do not specify a controller
E. Use a standard controller

1. Which governor limit applies to all the code in an Apex transaction?

A. Elapsed SOQL query time
B. Number of classes called
C. Number of new records created
D. Elapsed CPU time

2. A developer wants multiple test classes to use the same set of test data?
How should the developer create the test data ?

A.Reference a test utility class in each test class
B. Create a test setup method for each test class
C. Define variables for test records in each test class
D. Use SeeAllData = true annotation in each test class

3. A developer needs to apply the look and feel of lightning experience to a number of applications built using a custom third-party JavaScript framework and rendered in visualforce pages.
Which option can achieves this? 

A. Set the attribute enablelightning to "true" in the definition
B. Replace the third-party JavaScript library with native visualforce tags
C. Configure the user interface options in the setup menu to enable legacy mode for visualforce
D. Incorporate salesforce lightning design system CSS stylesheets into the JavaScript applications

4. What is considered the primary purpose for creating apex tests?
A. To guarantee at least 50% of code is covered by unit tests before it is deployed
B. To ensure every usecase of the application is covered by a test
C. To confirm every trigger is executed at leat once.
D. To confirm all classes and triggers compile successfully

5. Which declarative method helps to ensure quality data?

A. Workflow alerts
B. Page layouts
C. Lookup filters
D. Validation rules
E. Exception handling

6. A developer creates an Apex helper class to handle complex trigger logic. How can the helper class warn users when the trigger exceeds DML governor limits?
A. By using ApexMessage.Message() to display an error message after the number of DML statements is excel
B. By using Messaging.SendEmail() to conthtinue the transaction and send an alert to the user after the number DML statements is exceeded.
C. By using PageReference.setRedirect() to redirect the user to a custom Visualforce page before the number DML statements is exceeded.
D. By using Limits.getDMLRows() and then displaying an error message before the number of DML statements exceeded. 

-- Which solution is correct A or D ?

7. A developer has a single custom controller class that works with a Visualforce Wizard to support creating and editing multiple sObjects. The wizard accepts data from user inputs across multiple Visualforce pages and from a parameter on the initial URL.
Which statement is unnecessary inside the unit test for the custom controller?
a.    Test.setCurrentPage(pageRef);
b.    String nextPage = controller.save().getUrl();
c.    ApexPages.currentPage().getParameters().put(‘input’, ‘testValue’);
d.    Public ExtendedController(ApexPages.StandardController cntrl) {}
A developer creates a customer controller and custom Visualforce page by using the following code block:
public class myController { public String myString;
public String getMyString() { return 'getMyString';
}
public String getStringMethod1() { return myString;
}
public String getStringMethod2() { if (myString == null)
myString = 'Method2'; return myString;
}
}

<apex:page controller="myController">

{!myString}, {!StringMethod1}, {!StringMethod2}, {!myString}

</apex:page>


What does the user see when accessing the custom page?

a.    getMysString, , Method2, getMyString
b.    , , Method2, getMyString
c.    , , Method2,
d.    getMyString, , ,
 
A developer in a Salesforce org with 100 accounts executes the following code using the Developer Console:
Account myAccount = new Account(Name=’MyAccount’);
insert myAccount;
  for(Integer x = 0; x < 150; x++) 
 {
  Account newAccount = new Account(Name=’MyAccount’ + x);
   try {
         insert newAccount;
         } catch(Exception ex) {
      System.debug(ex);
   }
}
insert new Account(Name='MyAccount');

How many accounts are in the org after this code is run? And why that count ?
A. 101
B. 100

C. 102
D. 252
There's an custom object "Student" and 
Field 1 :  Subject
Field 2  :  Branch
Current Scenario - Subject = Maths, Social, English, Arts
Branch(Multi picklist)  - Science , Humanities, Commerce

Requirement :
Given : Subject - Maths & Branch - Humanities
TODO : For all picklist field with value Branch = Humanities,
 Change Field value of Subject from Maths to English for all existing records in object.

What is the best possible way to achieve this by configuration ?
Which three are valid controller options for the following page? A developer is asked to create a custom visualforce page that will be used as a dashboard component.

A. Use a custom controller
B. Use a custom controller with extensions
C. Use a standard controller with extensions
D. Do not specify a controller
E. Use a standard controller

1. Which governor limit applies to all the code in an Apex transaction?

A. Elapsed SOQL query time
B. Number of classes called
C. Number of new records created
D. Elapsed CPU time

2. A developer wants multiple test classes to use the same set of test data?
How should the developer create the test data ?

A.Reference a test utility class in each test class
B. Create a test setup method for each test class
C. Define variables for test records in each test class
D. Use SeeAllData = true annotation in each test class

3. A developer needs to apply the look and feel of lightning experience to a number of applications built using a custom third-party JavaScript framework and rendered in visualforce pages.
Which option can achieves this? 

A. Set the attribute enablelightning to "true" in the definition
B. Replace the third-party JavaScript library with native visualforce tags
C. Configure the user interface options in the setup menu to enable legacy mode for visualforce
D. Incorporate salesforce lightning design system CSS stylesheets into the JavaScript applications

4. What is considered the primary purpose for creating apex tests?
A. To guarantee at least 50% of code is covered by unit tests before it is deployed
B. To ensure every usecase of the application is covered by a test
C. To confirm every trigger is executed at leat once.
D. To confirm all classes and triggers compile successfully

5. Which declarative method helps to ensure quality data?

A. Workflow alerts
B. Page layouts
C. Lookup filters
D. Validation rules
E. Exception handling

6. A developer creates an Apex helper class to handle complex trigger logic. How can the helper class warn users when the trigger exceeds DML governor limits?
A. By using ApexMessage.Message() to display an error message after the number of DML statements is excel
B. By using Messaging.SendEmail() to conthtinue the transaction and send an alert to the user after the number DML statements is exceeded.
C. By using PageReference.setRedirect() to redirect the user to a custom Visualforce page before the number DML statements is exceeded.
D. By using Limits.getDMLRows() and then displaying an error message before the number of DML statements exceeded. 

-- Which solution is correct A or D ?

7. A developer has a single custom controller class that works with a Visualforce Wizard to support creating and editing multiple sObjects. The wizard accepts data from user inputs across multiple Visualforce pages and from a parameter on the initial URL.
Which statement is unnecessary inside the unit test for the custom controller?
a.    Test.setCurrentPage(pageRef);
b.    String nextPage = controller.save().getUrl();
c.    ApexPages.currentPage().getParameters().put(‘input’, ‘testValue’);
d.    Public ExtendedController(ApexPages.StandardController cntrl) {}
A developer creates a customer controller and custom Visualforce page by using the following code block:
public class myController { public String myString;
public String getMyString() { return 'getMyString';
}
public String getStringMethod1() { return myString;
}
public String getStringMethod2() { if (myString == null)
myString = 'Method2'; return myString;
}
}

<apex:page controller="myController">

{!myString}, {!StringMethod1}, {!StringMethod2}, {!myString}

</apex:page>


What does the user see when accessing the custom page?

a.    getMysString, , Method2, getMyString
b.    , , Method2, getMyString
c.    , , Method2,
d.    getMyString, , ,
 
A developer in a Salesforce org with 100 accounts executes the following code using the Developer Console:
Account myAccount = new Account(Name=’MyAccount’);
insert myAccount;
  for(Integer x = 0; x < 150; x++) 
 {
  Account newAccount = new Account(Name=’MyAccount’ + x);
   try {
         insert newAccount;
         } catch(Exception ex) {
      System.debug(ex);
   }
}
insert new Account(Name='MyAccount');

How many accounts are in the org after this code is run? And why that count ?
A. 101
B. 100

C. 102
D. 252