+ Start a Discussion

confused with questions

Kindly anyone can help on below 4 questions for PD:
thanks in advance

1. Universal Containers has an order system that uses an Order Number to identify an order for customers and service agents.  Order records will be imported into Salesforce
How should the Order Number field be defined in Salesforce?
A. Lookup
B. Direct Lookup
C. Number with External ID – is this the correct answer?
D. Indirect Lookup

2. A developer needs to have records with specific field values in order to test a new Apex class.
What should the developer do to ensure the data is available to the test?

A. use Test.loadData() and reference a CSV file.
B. use SOQL to query the org for the required data.
C. use Test.loadData() and reference a static resource. – is this the correct answer?
D. use Anonymous Apex to create the required data.

3. Which code in a Visualforce page and/or controller might present a security vulnerability?
 A. <apex:outputField value="{!ctrl.userInput}" />

 B. <apex:outputText escape="false" value=" {!$CurrentPage.parameters.userInput}" />

 C. <apex:outputText value="{!£CurrentPage.parameters.userInput}" />   -- is this the correct answer?

 D. <apex:outputField escape="false" value="{!ctrl.userInput}" />

4. A Next Best Action strategy uses an Enhance Element that invokes an Apex method to determine a discount level for a Contact, based on a number of factors.

What is the correct definition of the Apex method?
A. @InvocableMethod
     global static ListRecommendation getLevel(List<ContactWrapper> input)
B. @InvocableMethod
     global static List<List<Recommendation>> getLevel(List<ContactWrapper> input)
     {/*implementation*/}      - Is this the correct answer?
C. @InvocableMethod
     global List<List<Recommendation>> getLevel(List<ContactWrapper> input)
D. @InvocableMethod
     global Recommendation getLevel(ContactWrapper input)

4.  A developer created this Apex trigger that calls
MyClass .myStaticMethod: trigger myTrigger on Contact(before insert) ( MyClass.myStaticMethod(trigger.new, trigger.oldMap); }

The developer creates a test class with a test method that calls MyClass.mystaticMethod, resulting in 81% overall code coverage. What happens when the developer tries to deploy the trigger and two classes to production, assuming no other code exist?

 A. The deployment fails because the Apex trigger has no code coverage. –is this the right answer becuz the test method did not cover the trigger?
 B. The deployment fails because no assertions were made in the test method.
 C. The deployment passes because the Apex code has required (>75%) code coverage.
 D. The deployment passes because both classes and the trigger were included in the deployment.
Pritha Gupta 6Pritha Gupta 6

1.  C is right

2. C is right.

Aditya Sharma 114Aditya Sharma 114
All of the answers suggested by you are correct. Kudos!!
weno bakweno bak
Hello there, I discovered your web site by means of Google even as looking for a similar matter, your website got here up, and it seems to be good. I have bookmarked it in my google bookmarks. Hi there, just changed into aware of your blog through Google, and found that it is really informative. I’m gonna be careful with Brussels. I will appreciate when you continue this in future. Many other people will be benefited out of your writing. Cheers! If you like video games then visit the given link and know interesting facts “Sims 4 cheats how to become a vampire (https://gtacheatcode.com/sims-4-vampire-cheats/)” and click here for “hoi4 console commands.
Soundar Rajan PonpandiSoundar Rajan Ponpandi
HI Wate,

Please find the accurate answer here!

1. C. Number with External ID - An external ID is a custom field that has the “External ID” attribute, meaning that it contains unique record identifiers from a system outside of Salesforce. When you select this option, the import wizard will detect existing records in Salesforce that have the same external ID.

2. C. use Test.loadData() and reference a static resource. 
public class StaticResourceTest {

      static testmethod void staticResourceLoad(){
        //Load CSV file saved in static resource  
        List<SObject> lstAcc = Test.loadData(Account.sObjectType,'AccountLoad_Test');
        List<SObject> lstCon = Test.loadData(Contact.sObjectType,'ContactLoad_Test');
        //Confirm that total number of accounts created are 5
        System.assertEquals(lstAcc.size(), 5);
        for(Account a : [SELECT Id, Name, (SELECT FirstName,LastName FROM Contacts) FROM Account where Id IN :lstAcc]){
            //confirm that every Account has associated child contact
            System.assertNotEquals(null, a.contacts);
            //confirm that every Account has exactly 2 contacts
            System.assertEquals(a.contacts.size(), 2);

3. B. <apex:outputText escape="false" value=" {!$CurrentPage.parameters.userInput}" />

4. B. @InvocableMethod
     global static List<List<Recommendation>> getLevel(List<ContactWrapper> input) {/*implementation*/

5. C. The deployment passes because the Apex code has required (>75%) code coverage.

Please Mark this one as best answer.


Jacob BrennemanJacob Brenneman
Soundar has some good answers/explanations here, but it seems to me (and it looks like the majority consensus online is) that #5 should be A: The deployment fails because the Apex trigger has no code coverage.
Lita WilliamsLita Williams
Cóinbase Pro login is simple, secured, safe and rapid to use. This platform offers you a special office with leading science which will raise your buys & dealings in digital assets exchange at a minimum cost. The Cóinbase Pro login is considered as the best platform for purchasing and selling cryptocurrencies that is accessible to every individual from any corner of the world.

Henry Joseph 2Henry Joseph 2
MetáMásk Login allows you to store & manage your account keys, transactions, tokens and send & receive the cryptocurrencies. With MetáMásk, you can safely associate to the decentralized apps through a compatible web browser. MetáMásk Login platform is safer than web wallets and hardware or paper wallets. Users can have a paper with keys printed on them.

Mike RoditisMike Roditis
In the second question why isn't b correct?