Hawerth Castro
Quiz von , erstellt am more than 1 year ago

Salesforce DEV 401 Quizzes Dumps preparing certified

414
0
0
Hawerth Castro
Erstellt von Hawerth Castro vor fast 7 Jahre
Schließen

SALESFORCE DEV-401 Certification Evaluation 1

Frage 1 von 59

1

A developer writes a before insert trigger. How can the developer access the incoming records in the trigger body?

Wähle eine der folgenden:

  • By accessing the Trigger.new context variable.

  • By accessing the Trigger.newRecords context Variable.

  • By accessing the Trigger.newMap context variable.

  • By accessing the Trigger.newList context variable.

Erklärung

Frage 2 von 59

1

In an organization that has enabled multiple currencies, a developer needs to aggregate the sum of the Estimated_value__c currency field from the campaignmember object a roll-up summary field called total_estimated_value__c on campaign.

How is the currency of the total_Estimated_value__c roll-up summary field determined?

Wähle eine der folgenden:

  • The values in campaignmember.estimated_value__c are converted into the currency of the campaign record, and the sum is displayed using the currency on the campaign record.

  • The values in campaignMember.Estimated_value__c are converted into the currency on the majority of the campaignmember records and the sum is displayed using that currency.

  • The values in campaignMember.Estimated_value__c are summed up and the resulting Total_Estimated_value__c field is diaplyed as a numeric field on the campaign record.

  • The values in campaignMember.Estimated_value__c are converted into the currency of the currentuser, and the sum is displayed using the currency on the campaign record.

Erklärung

Frage 3 von 59

1

When creating unit tests in apex, which statement is accurate?

Wähle eine der folgenden:

  • Unit tests with multiple methods result in all methods failing every time one method fails.

  • Increased test coverage requires large test classes with many lines of code in one method.

  • Triggers do not require any unit tests in order to deploy them from sandbox to production.

  • System assert statement that do not increase code coverage contribute important feedback in unit tests.

Erklärung

Frage 4 von 59

1

An sObject named Application_c has a lookup relationship to another sObject named Position_c. Both Application_c and Position_c have a picklist field named Status_c.
When the Status_c field on Position_c is updated, the Status_c field on Application_c needs to be populated automatically with the same value, and execute a workflow rule on Application_c.
How can a developer accomplish this?

Wähle eine der folgenden:

  • By changing Application__c.Status__c into a roll-up summary field.

  • By changing Application__c.Status__c into a formula field.

  • By using an apex trigger with a DML operation.

  • By configuring a cross-object field update with a workflow.

Erklärung

Frage 5 von 59

1

A developer has the following trigger that fires after insert and creates a child case whenever a new case is created.

List<case> childcases = new List<case>();

for(case parent : trigger.new)

{

case child = new case(parentId = parent.Id, subject = parent.subject);

childcases.add(child);

}

insert childcases;

What happens after the code block executes?

Wähle eine der folgenden:

  • Multiple child cases are created for each parent in trigger.new

  • Trigger enters infinite loop and eventually fails

  • case is created for each parent case in trigger.new

  • The trigger fails if subject field on parent is blank

Erklärung

Frage 6 von 59

1

How can a developer avoid exceeding governor limits when using an apex trigger?
Choose 2.

Wähle eine oder mehr der folgenden:

  • By using a helper class that can be invoked from multiple triggers.

  • By using the database class to handle DML transactions.

  • By using maps to hold data from query results.

  • By performing DML transactions on lists of sobjects.

Erklärung

Frage 7 von 59

1

Why would a developer use Test.starttest() and test.stoptest()?

Wähle eine der folgenden:

  • To avoid Apex code coverage requirements for the code between these lines.

  • To start and stop anonymous block execution when executing anonymous Apex code.

  • To indicate test code so that it does not impact apex line count governor limits.

  • To create an additional set of governor limits during the execution of a single test class.

Erklärung

Frage 8 von 59

1

In which order does salesforce execute events upon saving a record?

Wähle eine der folgenden:

  • Before Triggers; Validation Rules; After Triggers; Assignment Rules; Workflow Rules; Commit

  • Validation Rules; Before Triggers; After Triggers; Workflow Rules; Assignment Rules; Commit

  • Before Triggers; Validation Rules; After Triggers; Workflow Rules; Assignment Rules; Commit

  • Validation Rules; Before Triggers; After Triggers; Assignment Rules; Workflow Rules; Commit

Erklärung

Frage 9 von 59

1

When loading data into an organization, what can a developer do to match records to update existing records?
Choose 2

Wähle eine oder mehr der folgenden:

  • Match an external id text field to a column in the imported file.

  • Match the id field to a column in the imported file.

  • Match the name field to a column in the imported file.

  • Match an auto-generated number field to a column in the imported file.

Erklärung

Frage 10 von 59

1

How can a developer refer to, or instantiate, a pagereference in apex?
Choose 2

Wähle eine oder mehr der folgenden:

  • By using a pagereference with a partial or full URL.

  • By using the page object and a Visualforce page name.

  • By using the apexPage.page() method with a visualforce page name.

  • By using the PageReference.page() method with a partial or full URL.

Erklärung

Frage 11 von 59

1

What is the minimum log level needed to see user-generated debug statements?

Wähle eine der folgenden:

  • DEBUG

  • FINE

  • INFO

  • WARN

Erklärung

Frage 12 von 59

1

In the code below what type does Boolean inherit from?

Boolean b =true;

Wähle eine der folgenden:

  • Enum

  • Object

  • String

  • Class

Erklärung

Frage 13 von 59

1

On a Visualforce page with a custom controller, how should a developer retrieve a record by using an ID parameter that is passed on the URL?

Wähle eine der folgenden:

  • Use the constructor method for the controller.

  • Use the $Action.View method in the Visualforce page.

  • Create a new PageReference object with the Id.

  • Use the <apex:detail> tag in the Visualforce page.

Erklärung

Frage 14 von 59

1

A developer wrote a workflow email alert on case creation so that an email is sent to the case owner manager when a case is created. When will the email be sent?

Wähle eine der folgenden:

  • After committing to database.

  • Before committing to database.

  • Before Trigger execution.

  • After Trigger Execution.

Erklärung

Frage 15 von 59

1

The Review__c object has a lookup relationship up to the Job_Application__c object. The Job_Application__c object has a master-detail relationship up to the Position__c object. The relationship field names are based on the auto-populated defaults. What is the recommended way to display field data from the related Review__c records on a visualforce page for a single Position__c record?

Wähle eine der folgenden:

  • Utilize the standard controller for Position__c and cross-object formula fields on the Job_Application__c object to display Review__c data.

  • Utilize the standard controller for Position__c and a Controller extension to query for Review__c data.

  • Utilize the standard controller for Position__c and expression syntax in the page to display related Review__c data through the Job_application__c object.

  • Utilize the standard controller for Position__c and cross-object Formula fields on the Review__c object to display Review_C data.

Erklärung

Frage 16 von 59

1

Which standard field needs to be populated when a developer inserts new contact records?

Wähle eine der folgenden:

  • AccountID

  • Name

  • LastName

  • FirstName

Erklärung

Frage 17 von 59

1

What is the result when a Visualforce page calls an Apex controller, which calls another apex class.
Which then results in hitting a governor limit?

Wähle eine der folgenden:

  • Any changes up to the error are saved.

  • Any changes up to the error are rolled back.

  • All changes before a savepoint are saved.

  • All changes are saved in the first apex class.

Erklärung

Frage 18 von 59

1

When the number of records in a recordset is unknown, which control statement should a developer use to implement set of code that executes for every record in the recordset, without performimg a.size()orlength() method call?

Wähle eine der folgenden:

  • For(init_stmt; exit_condition;increment_stmt){-----}

  • Do{---}while(condition)

  • For(variable :list_or_set){----}

  • while(condition){---}

Erklärung

Frage 19 von 59

1

What is a capability of cross-object formula fields?
Choose 3

Wähle eine oder mehr der folgenden:

  • Formula fields can reference fields from master-detail or lookup parent relationships.

  • Formula fields can expose data the user does not have access to in a record.

  • Formula fields can be used in three roll-up summaries per object.

  • Formula fields can reference fields in a collection of records from a child relationship.

  • Formula fields can reference fields from objects that are up to 10 relationships away

Erklärung

Frage 20 von 59

1

A developer wants to display all of the available record types for a Case object. The developer also wants to display the picklist values for the Case.Status field. The Case object and the Case.Status field are on a custom visualforce page. Which action can the developer perform to get the record types and picklist values in the controller?
Choose 2

Wähle eine oder mehr der folgenden:

  • Use schema.picklistEntry returned by case.Status.getDescribe().getPicklistValues().

  • Use schema.RecordTypeInfo returned by case.SobjectType.getDescribe().getRecordTypeInfos().

  • Use SOQL to query case records in the org to get all the RecordType values available for case.

  • Use SOQL to query case records in the org to get all values for the Status picklist field.

Erklärung

Frage 21 von 59

1

A developer has a block of code that omits any statements that indicate whether the code block should execute with or without sharing.

What will automatically obey the organization-wide defaults and sharing settings for the user who executes the code in the salesforce organization?
Choose 2

Wähle eine oder mehr der folgenden:

  • Apex Triggers

  • Http Callouts

  • Apex controllers

  • Anonymous blocks

Erklärung

Frage 22 von 59

1

A developer wants to create a custom object to track customer invoices. How should invoices and accounts be related to ensure that all invoices are visible to everyone with access to an Account?

Wähle eine der folgenden:

  • The Account should have a lookup relationship to the invoice.

  • The Invoice should have a Master-detail relationship to the Account.

  • The Account should have a Master-detail relationship to the Invoice.

  • The Invoice should have a lookup relationship to the account.

Erklärung

Frage 23 von 59

1

Which requirement needs to be implemented by using standard workflow instead of process?
Choose 2

Wähle eine oder mehr der folgenden:

  • Create activities at multiple intervals.

  • Send an outbound message without apex code.

  • Copy an account address to its contacts.

  • Submit a contract for approval.

Erklärung

Frage 24 von 59

1

A developer creates a workflow rule declaratively that updates a field on an object. An apex update trigger exists for the object

What happens when a user updates a record?

Wähle eine der folgenden:

  • No changes are made to the data.

  • Both the apex trigger and workflow rule are fired only once.

  • The workflow rule is fired more than once.

  • The apex trigger is fired more than once.

Erklärung

Frage 25 von 59

1

A developer uses a before insert trigger on the lead object to fetch the Territory__C object, Where the Territory__c.postalcode__c matches the lead.postalcode. The code fail when the developer uses the apex data loader to insert 10000 lead records. The developer has the following code block;

01 for(lead L: trigger.new){

02 if(L.postalcode !=null){

03 List<Territory__c> terrList=[select id from Territory__c where posatalcode__c :

04 if(terrList.size() >

05 {L.territory__c = terrList[0].id;

06 }

07 }

08 }

which line of code is causing the code block to fail?

Wähle eine der folgenden:

  • 03: A soql query is located inside of the for loop code.

  • 01: Trigger.new is not valid in a before insert trigger.

  • 02: A nullpointer exception is thrown if postalcode is null

  • 05: The lead in a before insert trigger cannot be updated.

Erklärung

Frage 26 von 59

1

What is a characteristic of the lightning component framework?
Choose 2

Wähle eine oder mehr der folgenden:

  • It has an event-driven architecture.

  • It works with existing Visualforce pages.

  • It includes responsive components.

  • It uses XML as its data format.

Erklärung

Frage 27 von 59

1

What is an accurate statement about with sharing keyword?
Choose2

Wähle eine oder mehr der folgenden:

  • Inner classes do not inherit the sharing settings from the container class.

  • Both inner and outer classes can be declared as with sharing.

  • Either inner or outer classes can be declared as with sharing, but not both.

  • Inner classes inherit the sharing settings from the container class.

Erklärung

Frage 28 von 59

1

When would a developer use a custom controller instead of a controller extension?
Choose 2

Wähle eine oder mehr der folgenden:

  • When a Visualforce page needs to replace the functionality of a standard controller.

  • When a Visualforce page does not reference a single primary object.

  • When a Visualforce page should not enforce permissions or field-level security.

  • When a Visualforce page needs to add new actions to a standard controller.

Erklärung

Frage 29 von 59

1

What is a correct pattern to follow when programming in apex on a multi-tenant platform?

Wähle eine der folgenden:

  • Apex code is created in a separate environment from schema to reduce deployment errors.

  • DML is performed on one record at a time to avoid possible data concurrency issues.

  • Queries select the fewest fields and records possible to avoid exceeding governor limits.

  • Apex classes use the "with sharing" keyword to prevent access from other server tenants.

Erklärung

Frage 30 von 59

1

A company that uses a custom object to track candidates would like to send candidate information automatically to a third-party human resources system when a candidate is hired.

What can a developer do to accomplish this task?

Wähle eine der folgenden:

  • Create an escalation rule to the hiring manager.

  • Create an auto response rule to the candidate.

  • Create a process builder with an outbound message action.

  • Create a workflow rule with an outbound message action.

Erklärung

Frage 31 von 59

1

A Developer wrote a workflow email alert on case creation so that an email is sent to the case owner manager when a case is created.

When will the email be sent?

Wähle eine der folgenden:

  • Before Trigger execution.

  • After Committing to database.

  • Before Committing to Database.

  • After Trigger Execution.

Erklärung

Frage 32 von 59

1

A custom exception named "RecordNotFoundException" is defined by the following code block;

public class RecordNotFoundException extends Exception{}

Which statement can a developer use to throw the custom exception?
Choose 2

Wähle eine oder mehr der folgenden:

  • Throw new RecordNotFoundException("Problem occurred");

  • Throw new RecordNotFoundException();

  • Throw RecordNotFoundException("Problem occurred");

  • Throw RecordNotFoundException();

Erklärung

Frage 33 von 59

1

Which type of code represents the controller in MVC architecture on the Force.com Platform?
Choose 2

Wähle eine oder mehr der folgenden:

  • JavaScript that is used to make a menu item display itself.

  • StandardContoller system methods that are referenced by visualforce.

  • Custom apex and javascript code that is used to manipulate data.

  • A static resource that contains CSS and images.

Erklärung

Frage 34 von 59

1

Which component is available to deploy using metadata API?
Choose 2

Wähle eine oder mehr der folgenden:

  • Case Layout

  • Account Layout

  • Case Feed Layout

  • Console Layout

Erklärung

Frage 35 von 59

1

What is a valid source and destination pair that can send or Receive change sets?
Choose2

Wähle eine oder mehr der folgenden:

  • Sandbox to production.

  • Developer edition to sandbox.

  • Developer edition to Production.

  • Sandbox to sandbox.

Erklärung

Frage 36 von 59

1

A developer needs to automatically populate the ReportsTo field in a contact record based on the values of the related Account and Department fields in the contact record.

What type of trigger would the developer create?
Choose 2

Wähle eine oder mehr der folgenden:

  • before update.

  • after insert.

  • before insert.

  • after update.

Erklärung

Frage 37 von 59

1

A developer needs to create records for the object Property__c. The developer creates the following code block:

01 List propertiesToCreate = helperclass.CreateProperties();

02 try{

03

04 } catch (Exception exp){ //Exception hadling }

Which line of code would the developer insert at line 03 to ensure that at least some records are created, even if a few records have errors and fail to be created?

Wähle eine der folgenden:

  • Database.insert(propertiesToCreate,System.ALLOW_PARTIAL);

  • insert propertiesToCreate;

  • Database.insert(propertiesToCreate, false);

  • Database.insert(propertiesToCreate);

Erklärung

Frage 38 von 59

1

A candidate may apply to multiple jobs at the company universal containers by submiting a single application per job posting once an application is submitted for a job posting, that application cannot be modified to be resubmitted to a different job posting.

What can the administrator do to associate an application with each job posting in the schema for the organization?

Wähle eine der folgenden:

  • Create a lookup relationship on both objects to a junction object called job posting applications object.

  • Create a master-detail relationship in the job postings custom object to the applications custom object.

  • Create a master- detail relationship in the application custom object to the job postings custom object.

  • Create a lookup relationship in the applications custom object to the job postings custom object.

Erklärung

Frage 39 von 59

1

A developer creates a new visualforce page and apex extension, and writes test classes that exercise 95% coverage of the new apex extension. changeset deployment to production fails with the test coverage warning; "average test coverage across all apex classes and triggers is 74%, at least 75% test coverage is required."

What can the developer do to successfully deploy the new visualforce page and extension?

Wähle eine der folgenden:

  • Create test classes to exercise the visualforce page markup.

  • Select “Disable parallel apex testing" to run all the tests.

  • Add test methods to existing test classes from previous deployments.

  • Select "Fast Deployment" to bypass running all the tests.

Erklärung

Frage 40 von 59

1

public class customController {
public string cString { get; set;}

public string getStringMethod1(){
return cString;
}

public string getStringMethod2(){
if(cString == null)
cString = 'Method2';
return cString;
}

}
<apex:page controller = "myController">

{!cString},{!StringMethod1}, {!StringMethod2}, {!cString}

</apex:page>

What does the user see when accessing the custom page?

Wähle eine der folgenden:

  • getMyString,,,

  • ,,Method2,

  • , ,Method2,getMyString

  • getMyString, , Method2,getMyString

Erklärung

Frage 41 von 59

1

What should a developer working in a sandbox use to exercise a new test class before the developer deploys that test class to production?
Choose 2

Wähle eine oder mehr der folgenden:

  • The Rest API and ApexTestRun method.

  • The Apex Test Execution page in salesforce Setup.

  • The Test menu in the developer console.

  • The Run Tests page in salesforce Setup.

Erklärung

Frage 42 von 59

1

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?

Wähle eine der folgenden:

  • Public Extendedcontroller(apexPages.StandardController cntrl){}

  • Apex.Pages.CurrentPage().getParameters().put('input', 'TestValue');

  • Test.setCurrentpage(pageRef);

  • String nextpage =controller.save().getURL();

Erklärung

Frage 43 von 59

1

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 < 250; 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?

Wähle eine der folgenden:

  • 101

  • 100

  • 102

  • 252

Erklärung

Frage 44 von 59

1

A developer has the following code block:
public class PaymentTax {
public static decimal SalesTax = 0.0875;
}
trigger OpportunityLineItemTrigger on OpportunityLineItem (before insert, before update) {
PaymentTax PayTax = new PaymentTax();
decimal ProductTax = ProductCost * XXXXXXXXXXX;
}
To calculate the productTax, which code segment would a developer insert at the XXXXXXXXXXX to make the value the class variable SalesTax accessible within the trigger?

Wähle eine der folgenden:

  • SalesTax.

  • PayTax.SalesTax.

  • PaymentTax.SalesTax.

  • OpportunityLineItemTrigger.SalesTax.

Erklärung

Frage 45 von 59

1

What is true of a partial sandbox that is not true of a full sandbox?
Choose2

Wähle eine oder mehr der folgenden:

  • More frequent refreshes.

  • Only includes necessary metadata.

  • Use of change sets.

  • Limited to 5 GB of data.

Erklärung

Frage 46 von 59

1

Which data structure is returned to a developer when performing a sosl search?

Wähle eine der folgenden:

  • A list of lists of sobjects.

  • A map of sObject types to a list of sObjects.

  • A map of sObject types to a lists of sObjects.

  • A list of SObjects.

Erklärung

Frage 47 von 59

1

What is a valid apex statement?

Wähle eine der folgenden:

  • Map conMap =[SELECT Name FROM Contact];

  • Account[] acctList = new List<Account>{new Account()};

  • Integer w, x, y =123, z='abc';

  • private static constant Double rate =7.75;

Erklärung

Frage 48 von 59

1

Which code segment can be used to control when the dowork() method is called?

Wähle eine der folgenden:

  • for(triggerIsRunning t : trigger.new){

    dowork();

    }

  • if(trigger.IsRunning){

    dowork();

    }

  • for(trigger.IsInsert t : trigger.new){

    dowork();

    }

  • if(trigger.IsInsert){

    dowork();

    }

Erklärung

Frage 49 von 59

1

What is the preferred way to reference web content such as images, style sheets, JavaScript, other libraries that is used in Visualforce pages?

Wähle eine der folgenden:

  • By accessing the content from chatter files.

  • By uploading the content in the documents tab.

  • By accessing the content from a third-party CDN.

  • By uploading the content as a Static Resource.

Erklärung

Frage 50 von 59

1

To which primitive data type in apex is a currency field automatically assigned?

Wähle eine der folgenden:

  • Integer

  • Decimal

  • Double

  • Currency

Erklärung

Frage 51 von 59

1

A company has a custom object named warehouse. Each warehouse record has a distinct record owner, and is related to a parent account in salesforce.

What kind of relationship would a developer use to relate the account to the warehouse?

Wähle eine der folgenden:

  • One-to-Many

  • Lookup

  • Master-Detail

  • Parent-Child

Erklärung

Frage 52 von 59

1

A Developer is creating an application to track engines and their parts. An individual part can be used in different types of engines.

What data model should be used to track the data and to prevent orphan records?

Wähle eine der folgenden:

  • Create a junction object to relate many engines to many parts through a master-detail relationship.

  • Create a master-detail relationship to represent the one-to many model of engines to parts.

  • Create a lookup relationship to represent how each part relates to the parent engine object.

  • Create a junction object to relate many engines to many parts through a lookup relationship

Erklärung

Frage 53 von 59

1

What is a valid statement about apex classes and interfaces?
Choose 2

Wähle eine oder mehr der folgenden:

  • The default modifier for a class is private.

  • Exception classes must end with the word exception.

  • A class can have multiple levels of inner classes.

  • The default modifier for an interface is private.

Erklärung

Frage 54 von 59

1

Which resource can be included in a lightning component bundle?
Choose 2

Wähle eine oder mehr der folgenden:

  • Apex Class

  • Adobe Flash

  • Helper

  • Documentation

Erklärung

Frage 55 von 59

1

What must the controller for a visualforce page utilize to override the standard opportunity?

Wähle eine der folgenden:

  • The standardsetcontroller to support related lists for pagination.

  • The opportunity standard controller for pre-built functionality.

  • A callback constructor to reference the standard controller.

  • A constructor that initializes a private opportunity variable.

Erklärung

Frage 56 von 59

1

An org has different apex class that provide account related functionality. After a new validation rule is added to the account object, many of the test methods fail. What can be done to resolve the failures and reduce the number of code changes needed for future validation rules?
Choose 2

Wähle eine oder mehr der folgenden:

  • Create a method that creates valid account records, and call this method from within test methods.

  • Create a method that loads valid account records from a static Resource, and call this method within test method

  • Create a method that performs a callout for a valid account record, and call this method from within test method

  • Create a method that queries for valid account records, and call this method from within test methods.

Erklärung

Frage 57 von 59

1

What would a developer do to update a picklist field on related opportunity records when a modification to the associated account record is detected?

Wähle eine der folgenden:

  • Create a process with process builder.

  • Create a workflow rule with a field update.

  • Create a lightning component.

  • Create a Visualforce page.

Erklärung

Frage 58 von 59

1

What is a capability of the force.com IDE?
Choose 2

Wähle eine oder mehr der folgenden:

  • Roll back deployments.

  • Run apex tests.

  • Download debug logs.

  • Edit metadata components.

Erklärung

Frage 59 von 59

1

A developer needs to provide a visualforce page that lets users enter product-specific details how can this be accomplished?
Choose 2

Wähle eine oder mehr der folgenden:

  • Download a Managed package from the AppExchange that provides a custom visualforce page

  • Create a new visualforce page and an apex controller to provide product data entry.

  • Copy the standard page and then make a new visualforce page for product data entry.

  • Download an unmanaged package from the AppExchange that provides a custom visualforce

Erklärung