Salesforce Platform Developer One

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

What can be used to isolate a static html file on seperate domain

$IFRAMERESOURCE.<resource_name> where resource_name is the name of a static resource

when a new sandbox is created, what happens to the users email addresses

.invalid is appended to the end

A company has a requirement to track vehicles assigned to work orders. wehivles exist without a work order and have a record owner. what kind of relationship should be created between work orders and vehicle 1 lookup 2master detail 3picklist 4 heiracrchy

1 a lookup relationship allows objects to be loosely related and allows independent record ownership

Sam is required to define custom fields on the User object that would record a secondary manager in a matrix organizational structure. which relationshup type should be used to achieve this? 1 hierarchical 2 lookupp 3 master detail 4 none of these

1 lookup and master detail relationships are not avialable on the user object. it can only be linked with itself, which is possible through a heirarchical relationship

A developer needs to create a custom object related to account. how can the dev ensure that all related records are also visible to users that have access to the parent acct 1create a master detail rel field on the custom object 2create a lookup field on the custom object 3create a lookup rel. field on the accotun 4create a master det relationship field on acct

1 the detail object in a M-D relationshp inherits sharing of the master object. the rel. is established by creating a master detail rel. on the detail object. objects in lookup relationships are loosely coupled and have independant sharing setting, so it wouldnt be appropriate to use that type here

How can a developer ensure that a variable 'Day' will only contain specific set of constants such as SUNDAY, MONDAY, ...SATURDAY? What should variable 'Day' be declared as? 1 enum Day {SUNDAY, MONDAY, ...SATURDAY} 2 list<String>Day {SUNDAY, MONDAY, ...SATURDAY} 3 set<String>Day {SUNDAY, MONDAY, ...SATURDAY} 4 map<Id, String>Day {SUNDAY, MONDAY, ...SATURDAY}

1 An enum is an abstract data type with values that each take on exactly one of a finite set of identifiers that you specify. Use enumerations (enums) to specify a set of constants.

A Salesforce developer is trying to create a trigger that will set the record type of an Invoice record, prior to insertion, based on the value of the Industry picklist that is selected. What trigger event should the developer use? 1. before insert 2. after insert 3. before delete 4. after update

1 Before triggers are used to update or validate record values before they are saved to the database. In this case, record type will be set depending on the invoice Industry picklist value prior to insertion. Using After Insert will make the record read-only, so the record type cannot be set.

what is the discretionary clause added to a sosl query to specify the information to be returned in the text search result 1 returning 2 offset n 3 limit n 4 order by

1 returning is an optional clause that can be added to a sosl query to specify the information reutned in the text search result. use the returning clause to restrict the results that aare returned from the search() call

a dev is building a soql relationship query, which are true 1. a relationship bt the objects is required in order to create a join in soql 2. for a parent to child relationship, only one level can be specified in a query 3. up to five levels of parent to child relationship can be specified ina query 4. for a child to parent relationship, only one level can be specified in a query

1,2 a relationship query is a query on multiple related standdard or custom object. the objects must be related in a parent ot child and child to parent relationship. to create a join in soql, a rel is req bt the two objects only one level of parent to child relationships and no more than 5 levels can be specified in a child to parent erlationship

a developer is required to create an apex trigger on the case object to populate a certain custom field where its value is determined based on the field in its related acct record, which should be used 1. before inseret 2 before update 3 after insert 4 after update

1,2 an objects field values can be populated programatically using the trigger.new context variable for before tirggers. this action is allowed since this event occurs prior to the record being inserted or updated, so the values can still be set

which are valid uses of apex code 1server side calls from custom lightning components 2triggers 3web service 4custom button with javascript 5visualforce papge with standard controllers

1,2,3 VF pagesnwith standard controllers dont need apex code. by using apex code, a dev may implement web services, email services, comple validation over multiple objects, completz business processes that are not supported by workflow, custom transactional logic. lightning component use javascript on the client side and apex to make calls to the server side

what are considerations for deciding between using data loader and data import wizard for loading data into a dev environemtn 1 if the data needs to be loaded multiple times 2 if the object is supported by the data import tool 3number of records to be loaded 4if triggers should be run during data import 5data storage capacity of the org

1,2,3 data loader can load higher volumes than data import wizard. while both tools support custom obejcts, data import wizard does not support all standard objects, unlike data loader. mappings cannot be saved using the data import wizard, which makes data loadeer sutible for loading data mutliple times. Triggers will always run regardless of import method. data import wizard has options to prevent workflow rules and processes from firing when records are created or update. the data storage cap. of the org has no impacton which tool is used

which of the following access modifiers are available in apex 1 global 2public 3 private 4 restricted 5 default

1,2,3 supported apex access modifiers are private-this is the default, and means that the method or variable is accessible only within the apex class which it is defined. protected-the method or variable is visible to any inner classes in the defining apex class, and to classes that exten the defining apex class public-method or variable can be used by any apex in this namespace global-the method or variable can be used by any apex code that has access to the class, not just the apex code in the same application default and restricted do not exist

dev is considering standard controller on a VF page. which of the following are valid considerations? 1. standard controller provides a set of standard actions, such as create, edit, delete, and save, that you can add to your pages using standard UI elts such as buttons and links 2. to assoc a standard controller with a VF page, use the standardcontroller attribute on the <Apex:page> tag and assign it the name of any SF object that can be queried using force.com API 3. every standard controller includes a getter method that returns the record specified by the id query string paramater in the page url 4standard controller can retrive a list of items to be displayed, make a callout to an external web service, validate, and insert data 5. to assoc. a standard controller with a VF page, use the controller attribute on the <apex:page> tag and assign it to the name of any SF object that can be queried using force.com API

1,2,3 Standard controllers are not capable of making a callout to an external web service. Also, the 'standardController' attribute is used for associating the standard controller, not the 'controller' attribute as it is used for custom controllers.

A Salesforce Consultant has designed a record-triggered flow that is not working as expected. He has decided to use the 'Debug' option available in the Flow Builder to test and troubleshoot the flow. Which of the following are valid considerations for debugging a flow using this option? 1.if a flow uses any input vars, they can be specified during debugging 2. if a flow is closed during debugging, any DML opeations will be rolled back 3.displaying debug details always renders a flow in lightning runtime 4.a flow can only be restarted once its reached its end

1,2,3 The 'Debug' button available in the Flow Builder can be clicked in order to debug a flow. It allows specifying any input variables used by the flow and allows the flow to be run as another user if required. During debugging, a flow can be restarted at any point. If it is closed or restarted for any reason, any DML operation or executed Apex code is not rolled back. Debug details are displayed in a panel on the right. Displaying debug details renders a flow in Lightning runtime, even if Lightning runtime isn't enabled for the org.

which of these methods are valid ways to initialize a list? 1. List<account> acclist = new list<account>() 2. List<account>acclist = new account[]{} 3. Account[] accList=new Account[]{} 4. List<Account> new='accList'

1,2,3 expressions to initilize a list can be a new sobject, apex object, list, set, or map

When a trigger fires, it can process multiple records so all triggers should be written to accommodate bulk transactions. Which of the following are examples of single record and bulk transactions? Choose 3 answers. A. Data import B. Bulk Force.com API calls C. Lightning Events D. Mass actions E. Visualforce Actions

1,2,4 bulk triggers can handle both single record updates and bulk operations like data import, force.com bulk api calls, and mass actions. lightning events and visualforce actions both depend on a controller that should still utilize the use of Apex DML statements

select true about cross object formula fields 1. cross object formula fields can pull data from a record even if the user does not have access to it 2. cross object formula fields can pull values from master detail or lookup parent records 3. for every object, cross object formula fields can be used in 3 rollup summarys 4. cross object formula fieldscan pull field values from objects up to 10 relationships away 5. cross object formula fields can pull values from its child records

1,2,4 cross object formula fields can reference field values from related parent records. even though a user does not have access to a record, data from the record can still be visible to the user through cross object formula fields. formula fields can reference parent objects that aare up to 10 relationships away

a dev is trying to decide whether to use a master detail of lookup relationship bt 2 objects. which of the following considerations are ttrue 1 custom objects on the detail side of the md rel cannot have queues 2in a md rel, if the master record is delted, the detail records will be deleted autom. 3. child records in md rel. on custom objects cant be reparented 4 in md rel. the master record will be deleted when the only child is deleted 5. custom objects cant be on the master side of a rel with a standard object as detail

1,2,5 if there is a master detail relationship between 2 objects, when the record of the master/parent object is deleted, all children will be deleted. the master record is not deleted when any or all children are deleted. child records in a mastdetal relationship on custom objects can be reparented to different parent records by selecting allow reparenting option in the master detail rel definition custom objects cant be on the master side of master det rel if the detail object is a standard object

universal containers has tried the schema builder but has found that is has long loading times and objects are diff. to find bc there are too many objects and rel. displayed. what features would help 1map can be used to navigate obejcts of interest 2 the filter can be used to diplay only objects of interest 3fields can be hidden and only objects displayed 4activate lightweight mode in schema builder settings 5uf the hide relationships option is selected, performance is improved

1,2,5 objects can be hidden on the canvas while fields cannot. schema builder does not have a lightweight feature mode hiding rel. details reduce the rendering work needed on the canvas. using object filter minimizes number of objects that need to be rendered. using map feature helps navigate the canvas much quicker and find the required object

which of the follwing action methods are supported by standard controllers? 1. quicksave 2. delete 3. export 4. select 5. cancel

1,2,5 select and export arent standard controller actions. supported methods are save, quicksave, edit, delete, cancel, and list

Dynamic Computing would like to be able to manage sales tasks differently between their computer system sales and computer accessories sales and display different fields for each. How can this requirement be met? 1 record types 2 workflow rules 3page layouts 4 formula fields

1,3 Record types allow different sales processes, picklist values, and page layouts to be displayed based on the profile of the current user. Workflow rules are configured to respond to record creation and updates. Formula fields are read-only fields on a record whose values are evaluated from a formula or expression.

what are valid cases for the appexchange 1. to add industry specific functionality to salesforce 2. to exhcnage ideas and tips with other developers 3. to extend standard salesforce functionality 4. to exchange apps with other develoeprs

1,3 the appexchange ccan be sued to add industry specific funstionality such as real estate or extend standard sf functionality e.g calcualte sales tax on a quote

in aoex, an expression is a construct made up of variables, operators, and method invocations that evaluate to a single var. Which of the following are valid apex expressions 1. myclass.mymethod() 2. @future 3. new List<opportunity>() 4. 3+4

1,3,4 apex expressions can be a literal expression, a new sobject, apex object, list, set, or map, or a static or instance method invocation. @fututre is an annotation tto identify metjds are executed asynchronusly

what is true about custom exceptions? 1. they are capable of specifying detailed error messages and have additional custom error handling in catch blocks 2. built in and custom apex exceptions behave the same in throwing and catching exceptions 3. hey are orimarily useful if the method is called by another method and the exception handling is transferred to the other method 4. they are built by extending the built in exception class and should end with the word exception 5they are not capable of re-trhowing a caught exception

1,3,4 custm exceptions allow devs to throw and catch custom exceptions in methods. A developer an also re-throw the caught exception as an inner exception in a custom exception. this is primarily useful if the method is called by another method and transfers the exception handling to the other method. it is also capable of rethrowing caught exception

which 2 ways can a dev include javascript in a visualforce page 1. script> 2 ,javascript> 3. <apex:js> 2. <apex:includeScript>

1,4

which of the following is true regarding custom setting data 1. custom setting data can be accesed by formula fields, validation rules, apex, and VF pages 2. custom setting data cannot be queried using SOQL 3. custom setting data needs to be queried once using SOQL and then it is stored in the cache 4. there are 2 ty[e of custom setting data; heirarchy and list

1,4 List custom setting data provides a list of the data that can be reused and accesed by different tools across an org. heirarchy custom setting data uses heirarchical logic and allows settings to be customized specific to a user or profile all custom settings data is exposed in the application cache, which enables effiecient access without the cost of repeated qqueries to the database. this data cna then be used by formula fields, flow, apex, validation rules, and the SOAP API. custom settings can be accessed via custom cetting methods or using the $Setup variable. List custom setting data can only be accessed using Apex or API calls. Custom settings can be queried just like a custom object. Note: SF no longer requires list for custom settings. this needs to be enabled in schema settings. sf recomends custom metadata types instead bc records of custom metadata can be migrated using packages

select valid cases for using custom controller in visualforce page 1. a visualforce page needs to run in system mode 2. a visualforce page needs to add new actions to a standard controller 3. a visualforce page should override the save action of the standard controller 4. a visualforce page should replace the functionality of the standard controller

1,4 A custom controller is an Apex class that implements all of the logic for a page without leveraging a standard controller. Custom controllers run entirely in system mode, which does not enforce the permissions and field-level security of the current user. A custom controller is not required to override the save action, a controller extension can be used to override one or more actions such as edit, view, save or delete.

A developer needs to use exception handling to throw and catch an exception with a detailed error message in Apex. Which of the following are valid considerations for creating a custom exception for this use case? 1. a custom exception class should extend the exception class 2. a custom exception class should implement the exception interface 3. the name of a custom exception class should start with word exception 4. the name of a custom exception class should end with word exception

1,4 a custom exception can be created by creating a class that extends the exception class. the name fo the class should end with the word exception

which can be used to update existing standard and custom fields on child records when parent record is modified 1 process builder 2 workflow rule 3 formula field 4 apex trigger

1,4 process builder can be used to update related records including child records. apex trigger can be used to update related child records automatically. a workflow rule can be used to update only the master record that is related to the child record, using cross object field update action. lthough cross object formula field can be used to reference and display values in merge fields from a parent object if an object is on the detail side of a master detail relationship, it cannot update existing fields onthe detail records

what will happen when the following code is executed trigger CaseTrigger on Case (after insert) { List<Case> casesToInsert = new List<Case>(); for (Case parent: Trigger.new) { Case child = new Case(); child.ParentId = parent.Id; child.Subject = parent.Subject + ' Child'; casesToInsert.add(child); } insert casesToInsert; } 1. no parent or child cases will be created 2. child cases will be inserted foreach parent case 3. the trigger will thrwo an exception because it is not bulkified 4. the trigger will be recursively called and result in an infinite loop

1,4 the code consists of an after insert trigger which contains adml stmnt that inserts records of the same object. the dml statement will recursively invoke the trigger, resulting in an infinite loop, and eventually throw an exception. as a result, no parent or child cases will be crreated. to prevent trigger recursion, a static boolean variable can be used in the trigger helper class to make the trigger run only once per transaction

a dev would like to include custom logic from an apex class in a flow that has been created for web to lead inquiries on a public website. which of the following can b used to achieve this? 1. process.plugin 2. flow.interview 3. flow.plugin 4. @invocablemethdo annotation

1,4 the process.plugin interface can be implemented on an apex class, which can then be used by a floww in the flow builder toadd custom logic. the @invocable method annotation is recommended instead of the process.plugin interface as it provides more functinoality. flow.interview is used for accessing flow controllers and can be used to start flows. the other doesnt exist.

which are valid apex data types 1 blob 2 text 3 currency 4 enum 5 ID

1,4,5 currency and text arent valid data types. instead of currency and text, use decimal and string data types

a requirement has been given to display the avg value of won opps on the acct page layout. how can this be achieved? 1. roll up summary and formula fields 2. trigger on acct object 3. trigger on opp object 4. roll up summary field with average function

1. this requirement can be met by copleting the following configuration. a rollup summary field is created that counts the number of won opportunities. then, another roll up summary field is created that ssums the amt of won opps. then a new formula field is created that claclulate the average is totalwonamt/totalwoncount rollup summary fields have the count, sum, min, and max functions, but not average it is possible to create a trigger on the acct object, but it is not the best solution since the requirement cna be acheived declaritively

A developer is going through the Visualforce pages created in his company's org to identify and fix any potential vulnerabilities. One of the pages uses a static HTML file that has been downloaded from a third-party source. If 'resource_name' refers to the name that was specified when the file was uploaded as a static resource, which of the following should the developer use to reference the file on a separate domain and improve security? 1.$IFrameResource.<resource_name> 2.$Resource.<resource_name> 3.$IFrame.<resource_name> 4.$Library.<resource_name>

1. Static resources that are downloaded from an untrusted third party source can be isolated using iframe on a visualforce page. this adds an extra layer of security to the page and helps protect the assets. to reference a static html file on a seperate domain, @IFrameResource.<resource_name> can be used as a merge field, where resource_name is name of static resource.

A visualforce page uses a custom apex controller class. An ID paramater value was passed to the url. How can a salesforce developer retrieve the record using this value> 1. Use ApexPages.currentPage().getParameters() to get the parameter value then make a query to the record using the ID in the controller\'s constructor. 2. Use ApexPages.currentPage().getContent() to get the parameter value then make a query to the record using the ID in the controller\'s constructor. 3. Use ApexPages.currentPage().getAnchor() to get the parameter value then make a query to the record using the ID in the controller\'s constructor. 4. Use ApexPages.currentPage().getHeaders() to get the parameter value then make a query to the record using the ID in the controller\'s constructor.

1. The get{aramaters() method can be used to retrieve paramaters passed to the url. getcontent gets the rendered output of the vf page. getheader gets a map of the request headers. getacnhor gets the name of the anchor referenced in the page's url or the hashtag value

dev has written the code below in apex class to process account records. which of the following is true about vars named 'acc' for (Account a: acc){ code_block} 1. the variable can be a list or set of account records. 2. the var can be any sobject type 3. an increment statamt is required with acc to execute the 'code_block' more than once 4. the code_block is executed for only one elt of acct

1. This example shows a list or set iteration for loop that iterates over all the elements of 'acc' which can be a list or set of account records. This type of for loop follows this syntax: for (variable : list_or_set) { code_block } The variable must be of the same primitive or sObject type as the list_or_set. The loop iterates over all the elements of the list_or_set. An increment statement is only required in a traditional for loop.

a dev needs to update 10,005 Account records in an organization. what method can the dev use to avoid governer limits? 1. use Batch APEX 2. create method with @future annotation 3. write code to include a limit clause to restrict number of records selected for processing 4. write code in anonymous block

1. batch apex can be used to process large number of records. batch apex operates over small batches of records, covering your entire record set and breaking the process down into managable chunks

what attrivute should a dev use to assoc. a page with the standard controller for a cutom object 1 standardcontroller 2 visualconttroller 3 controller 4 customcontroller

1. even if the object to associate is a custom obejct, standardcontroller should still be used to utilize standard salesforce logic that is used foe standard salesforce pages. to assoc. a standard controller with a visualforce pgae, use the standardcontroller attribut on the <apex:page> tag and assign it the name of any slaesforce object that can be queried using the forcce.com api

what is true regarding cascading execution of triggers 1. cascading triggers are part of the same execution context with respect to gov limits 2. cascading execution of triggers will cause an excepion 3. each trigger will srart a new execution context 4. there is a limit of 5 triggers that can be executed from a cascading execution

1. if the execution of one trigger causes one or more additional triggers to be fired, the trigs are said to be cascading cascading trigs are part of the same execution context with respect to gov limits. salesforce enforces limits on operations such as the number of dml stmts and soql queries that can be issued to prevent recursion, but no limit is on number of triggers

A developer can write code to process records that allow successful inserts and record errors for unsuccessful inserts without rolling back the transaction. This is called partial processing. However, this method will not throw an exception. How should a developer handle the possible exceptions? 1. use database.saveresult class 2. use database.errorresult class 3. use database.successresult class 4. use databas. eachresult class

1. partial processing returns the results of an insert or update operation in an array of database.saveresult objects. one can loop thru the array and determine which records failed or succeeded by using the isSucces method of the saveresult objecct. the geterrors method is then used to get error info on the record database./errorresult/eachresult/successresult do not exist

A developer needs to write some code that will display 'Dreamforce 2018' if the string variable getAnswer is equal to 'Salesforce'. No action is required if the variable is not equal to 'Salesforce'. What control flow statement should the developer use? 1. IF 2. IF-Else 3. Switch 4. repeat Else If

1. the IF statement, is the most basic control flow statement and executed a certain section of code only if a particular test value evaluates to true

what method displays a custom error message on a particular record and prevents any DML operations thereafter 1. addError(errMsg) 2. throwError(errMsg) 3.add(errMsg) 4. clear(errMsg)

1. the addError(errMsg) method can be invoked at the record or field level within the trigger context to flag a record as invalid. it marks a record with a cutom error message and prevents any DML operations from occuring

dev needs to create a new acct recird with the following deets Account Name=sample account Account number= 123456789 Account rating=hot billing country=autralia what is the proper way of assigning these vals 1. Account acc = new Account(Name = 'Sample Account', AccountNumber = '123456789', Rating = 'Hot', BillingCountry = 'Australia'); 2. Account acc = new Account; Account.Name = 'Sample Account'; Account.AccountNumber = 123456789; Account.Rating = 'Hot'; Account.BillingCountry = 'Australia'; 3. acc = new Account<Name = 'Sample Account', AccountNumber = 123456789, Rating = 'Hot', BillingCountry = 'Australia'&lg; 5. Account acc = new Account[Name = 'Sample Account', AccountNumber = 123456789, Rating = 'Hot', BillingCountry = 'Australia'];

1. accountnumber is of type string and should be enclosed in quotes. an alternate syntac could be Account acc= new Account(); acc.Name='sample account'; acc.AccountNumber='123456789'; acc.Rating='Hot'; acc.BillingCountry='Australia';

A developer notices that the code below returns only 20 Account records though she expected 60. Which of the following is true regarding SOSL query limits? FIND {test} RETURNING Account(id), Contact, Opportunity LIMIT 60 1. results were evenly distributed amount the objects returned 2. limits cant be set in sosl queries 3. limits have to be individually assigned per object 4. the sosl syntax is incorrect

1. if a limit is set on the entire query, results are evenly distributed amounf the objects returned. limits can also be set per individual object

how can a dev get all picklist values for a specific field via apex 1 use the getpicklistvalues method 2 use fieldpicklist method 3 use describepicklist method 4 use globalpicklist method

1. the getdescribe method is used to obtain info on the field and then the getpicklistvalue is used to retrive the picklist values

Gov limits on DML stmt

150 per apex transaction

What is the method in the second line of the code snippet below called? public class sampleClass() { public sampleClass() { //CODE HERE public void sampleMethod() { //code here }} 1 modifier 2 constructor 3 extension 4 initiator

2 A constructor is code that is invoked when an object is created from the class blueprint. It has the same name as the class name. It should not return a value.

before deleting a record, a complex validation needs to be performed to confirm that the record can be deleted by querying a number of objects. what solution would be most inapropriate 1 validation rule 2apex trigger 3process builder 4flow builder

2 an apex trigger would be used to perform validation logic when a record is deleted, and prevent deletion if record doesnt pass valifation process builder cannot be invoked when a record is deleted. while it is possible to trigger a flow on deletion, it isnt capable of preventing a record from being deleted. validation rules cant be used on deletions

a developer executes the code below, how should the dev declare the variable isCorrect; if (isCorrect){ system,debug('value of x is true'); }else if (!isCorrect){ system.debug('value of x is false');} 1 String isCorrect; 2Boolean isCorrect; 3Blob isCorrect; 4enum isCorrect;

2 boolean is a calue that can only be assigned true, false or null

how can a dynamic SOQl query be created at runtime using input from an end user 1 ise the database.search(string) with a query specified in that string 2. use the database. query(string) with query spec. in that string 3. use the soql.execute(string) w qery soecified in that string 4. use database.execute(string) w query spec in that string

2 the database.query(string) can be used to retun a single or list of sobjects

What trigger context variable will return a map of IDs to old versions of the sObject records 1 newMap 2 oldMap 3 updateMap 4 insertMap

2 trigger.oldmap has the Id as the key and the old versions of the sobject records as value. this map is only vailable in update and delete triggers

what is the output integer z=5; do{z=z+1;} while{z<=15}; system.debug(z) 1. 13 2. 16 3. 15 4. 14

2, (16) the loop will iterate until such time the condition of the while block is evaluated as false, prior to this, the variable z is equal to16 do...then check, do...then check

which of the following action methods are supported by standard controllers 1 export 2 quicksave 3 delete 4 cancel 5 select

2,3,4 select and export are not standard controller actions. supported action methods ar save, quicksave, edit, delete, cancel, and list

soql statement results can evaluate to which of the following datatypes 1. AnString 2. List of Sobjects 3. Single sObject 4. An Integer

2,3,4 soql can return a single record, a list (collection, which includes map) of records, or an integer(if a count method is used)

A dev needs to execute an automated process when a platform event outside the SF dataase occurs. How might this be configured? 1. Set up email notifctions to notofy the admin when an external event ovvus. 2. use process builder to set up a process to manage an incoming platform event 3. subscribe a flow in flow builder to wait for incoming platform even messages 4. set up a workflow rule that will notify the dmin when an external event occurs 5 use rest API to submit a platform event from another system.

2,3,5 developers can automate business processes that are triggered by events that happen outside the SF database. using platform events and the rest api, an external system (a networked printer, for example) can call out to the salesforfce org. that call is recieved and can be handled by a flow that is subscribed to wait for that platform event either using a platform event triggered flow or a pause element in flow builder. workflow is used to automate standard internal processes and precedures7

the developer executes the code below and an error is returned indicating that a variable is not properly declared, what is the proper way of declaring a string data type variable String str=new String(); public void stringDisplay(){ srt='hello'; system.debug(str);} 1 Text str; 2 String str; 3 String new = str String(); 4 String=str();

2-String is a primitive data type so it doesnt need to be instantiated with new() command. it can be declared with or without an intiial value String variableName; or String variablen=Name='value'

dev would like to reutrn the dev name of a particular record type using a method of the recordtypeinfo class. which can do this 1. getRecrodTypeInfosByDevelopername() 2. getDeveloperName() 3. getrecordtypeinfosbyname 4. getName

2. the getDeveloperName() method of recordtypeinfo class can be used to return the dev name of a particular record type. the getnme method returns the ui label or a recod type. both 1 and 3 are methods of describesobjectresult class. former is sued to reutrn map mathcing dev to assoc record type. latter is used to return a map that matches record labels to assoc record type

What is the result of the following code insrting 200 Account newAccount = new Account ( Name= 'MyAccount-' + x); try { insert newAccount; System.debug(Limits.getDMLStatements()); } catch(exception ex) { System.Debug('Caught Exception'); System.Debug(ex); } } 1. a limit exception will be caught and one account will be inserted 2. no accounts will be inserted 3. 201 accounts will be inserted 4. 150 accounts will be inserted

2. the system enforces a dml limit of 150 stmts per apex transaction. if there are more than 150 items, the 151st update call returns an exception and cannot be caught for exceeding DML stmt limit of 150. all previous insertions will be rolled back. (Why last one not inserted?)

what is result of follwing code when testrawscore is 75 if (testRawScore >= 90) { gradeEqual = 'Grade A'; } else if (testRawScore >= 80) { gradeEqual = 'Grade B'; } else if (testRawScore >= 70) { gradeEqual = 'Grade C'; } else if (testRawScore >= 60) { gradeEqual = 'Grade D'; } System.debug(gradeEqual); 1. Grade A 2 Grade B 3 Grade C 4 Grade D

3 I lost the explanation but basically it evaluates the condition (is 75 greater than 90) down the line until the condition is true (75 is greaterthanequal to 70), then it changes the value of grade equal and exits the set of conditional statements.

apex is typially executed in system mode by default, but which of the follwingexecutes code as the current user 1. triggers 2. apex web services 3. anonymous code blockes 4. apex classes

3 all apex code runs in system mode, where the permissions and record sharing of the current user are disregarded. the exception to this is the anonymous blocks that run as current user

dev requires a variable numofstudents with a constant value of 25 that is accessible only within the apex class in which it is defined. which of the following is the best variable declaration 1public Integer numofstudents=25; 2global static Integer numofstudnts=25; 3private static final integer numofstudents=25; 4 protected Integer numofstudents=25;

3 from the statement itself, a variable numofstuednts is required that has a constant)Static, Final) value of 25(integer) and is accessible only weithin (private) the apx class it is defined global or public variables become accessible outside the class. protected variables becom accesible by classes that extend where they are defined in

if the dml below is performed, what is result Lead master = [SELECT Id, FirstName, LastName FROM Lead LIMIT 1]; // returns 1 record List<Lead> mergeList = [SELECT Id, FirstName, LastName FROM Lead LIMIT 3 OFFSET 1]; // returns 3 records merge master mergeList; 1 masteer record will be mergged into each record contained in mergelist 2. records in mergelist will be merged to master record 3. dml throws exception 4records in mergelist will be reparented to master

3 merge stmt will throw exception bc merge op ca only process up to 3 records at a time. master record and mergelist records have combined size of 4 in a succesful merge scenario, records in the mergelist will be merged into the master record. after the merge, records in mergelist will be deletedand any related records will be reprented

how can a dev access a static variable name taxrate decalred in a different apex class named taxcalc 1 taxcalc.taxrate() 2 new taxcalc().taxrate 3 taxcalc.taxrate 4 new taxcalc.taxrate

3 static variables declared in an apex class can be directly accessed without instantiating using the following syntax-Classname.staticvarname. a static method or variable doesnt require an instance of the class in order to run. static variables are not methods, so no parenthesis is needed.

which dml ops will allow other records in a list to be inserted even if there are records that have failed 1 insert exmple 2 upsert exmple 3 database.insert(exmpl, flase) 4 database.insert (exmpl, true)

3 the second param of the database insert method is an optional allornone paramater which specifies whether or not partial success is allowed. if set to false, and one of the records fails, the remaining records in list can still succeed. otherwise, an error will be thrown and transaction rolled back. if unspecified, default is true. the other 2 options dont allow partial success

which of the following code snippets are acceptable to be included within a looping stmt 1.Opportunity getOpp = [SELECT Id, AccountId FROM Opportunity WHERE AccountId =: acc.Id]; 2. insert accountList 3. System.debug('The following account has been updated' + 'acc.Id '); 4. if(acc.NumberOfEmployees > 5000){

3,4 a common mistake is that queries or dml stmts are placed inside a for loop. there is a gov limit that enforces a maximum number of soql queries. there is another that enforce max number of fml stmts (insert, undelete, etc). when these operations are placed inside a for loop, database operations are invoked once per iteration making it very easy to exceed these gov limits

if your company is selling only to businesses, which features of salesforce would be used? 1 person accounts 2 private contacts 3. business accts 4 contacts

3,4 when selling to businesses, customer info is stored in accounts. accts are the companies that business is done with and contacts are the people that work for them, and are related to the accts in sf. private contacts that are not related to an acct are only visible to the owner and the salesforce admin

which of the follwoing capabilites are provided by the core crm objects in the salesforce schema 1 recording time spent on projects in timesheets 2tracking customer invoices 3tracking sales deals and pipelines 4 recording customer feedback, probelms, or questions 5 tracking prospective customers

3,4,5 sales deals and pipelines are tracked in opportunites. cases can track customer feeddback, questions, and problems. Leads track and record prospective customers

what are some considerations regarding leads 1 opps must always be created from leads 2 when a lead is qualified, an acct, contact, and opp are always created 3 when a lead is created, it can automatically be assigned an owner 4 leads can be individual customers 5 leads can be imported or created from an automatic proces

3,4,5 when a lead is qualified and converted, either existing acct and contacts are selected or new records are created. Creating an opportunity is optional. sf can be set up to assign leads to the right owners based on criteria after creation. leads can be contacts that work for companies or individual consumer. they can be imported from a file or created from on automatic proces such as web-to-lead

What attribute should a developer use to assoc. a page with the sttandard controller for a custom object? 1. controller 2. visualController 3. standardController 4. customController

3. Even if the object is a custom object, standard controler should be used to utilize the standard salesforce logic that is used for standard salsforce pages. to assoc. a standard controller with a visualforce page, use the standard controller attribute on the <apex:page> tag and assign it the name fo any salesforce object that can be queried using the force.com API

a dev created a visualforce page with a standard controller for the contact object. how can the developer display fields from its related acct 1. Use a soql squery on the controller and setting the queried record to child records is posssible 2. only traversing fro parent to child records is possible 3use merge field syntax to traverse from child to parent 4 use seealldata=true annotation on visualforce controller

3. as with queries in the force.com api, you can use merge field syntax to retrieve data from related records. a edv can traverse up to 5 levels of child to paarent relationships. for example, if using the contact standard controller, a dev can use {!contact.Account.Owner.FirstName} a 3 level child to parent rel. its impossible to use a soql query on the standard controller. an extension is requireed for the VF page in that case. Also, traversing from both parent to child and child to parent are possible. the seealldata is only used with @isTest annotation, only used in testing.

a developer is instantiating a standardsetcontroller by passing in a list of sobjects. he knows there is a chance the list may contain more than 10k records. how can he check this condition programmatically by calling a method of the controller? 1. Call getCompleteResult(). A return value of TRUE means the controller won\'t be able to process all the returned records. 2. Call isComplete(). A return value of Falsemeans the controller won\'t be able to process all the returned records. 3. Call getCompleteResult(). A return value of FALSEmeans the controller won\'t be able to process all the returned records. 4. Call isComplete(). A return value of TRUE means the controller won\'t be able to process all the returned records.

3. indicates whether there are more records in the set than the max records limit. if this is false, there are more records than you can process.

per order of execution, when will an email created from a workflow email alert be sent 1. after workflow rule execution 2. when all before triggers are executed 3. after all dml operations are comited to the database 4. before entitlement rules execution

3. EXECUTION OF POST-COMMIT LOGIC, SUCh as sending emails will happen after all DML operations are commited to the database

there is a requirement to display the total expected revenue of opportunities associated with an account record. how can this be achieved? 1. create a trigger on opportunity to populate a custom field on the Account object 2.create a rollup summary field on th eopportunity object and display on the Account page layout 3. create a rollup summary field on the account object using SUM on opportunity 4. create a workflow on the opp object to populate a custom field on the acc object

3. a rollup summary field can be defined on the acct object to rollup the expected value of opps related to an account. rollup sums can include filters to include only records that meet certain criteria

if a dev needs to skip to the next iteration of a loop, what loop control structure should be used 1. end; 2. break; 3. continue; 4. skip;

3. the continue keyword is used to skip the current itertion of a loop and proceed to the next one. the break keyword is used to exit the entire loop. the end and skip are invalid keyword

a dev would like to use this sosl query in an apex class to search for a keyword. Which data type should be used to store the result returned by the query? FIND 'New York' IN ALL FIELDS RETURNING Account, Contact 1. List<Sobject> Map<Id, Contact> List<List<sObject>> Map<Account, Contact>

3. List<List<sObject>> Sosl stmts evaluate a list of lists of sObjects. Therefore, to store the search results of a sosl query, the answer can be used. Each list contains the search result for a particualr type of sobject. if not records are returned for a specified sobject type, the search results include an empty list for that sobject

given these options, what data type should the dev use to store queried records via soql 1 container 2 enum 3 group 4 list

4 a list is an ordered collection of elts that are distinguished by their indices. list should be used for storing queried records via soql. a map can also be used. group and container are invalid data types. an enum data type is used to store values from a finite set of indentifiers that are specified

What type of relationship is appropriate when an external object is acting as a parent to a standard or custom child object and records are matched by external id 1 indirect lookup 2parent external lookup 3lookip relationship 4external lookup

4 an external lookup relationship links a cchild standard, custom, or external object to a parent external object a lookup relationship is used to link a child standard or custom object to a parent standard or custom object an indirect relationship is used to link a child external record to a parent standard or cutom object. there is no parent external lookup relationship type

dev has created a list of 11k records. what happens if he instantiates a standard set controller using this list. 1 exception thrown 2. instantiated without issues 3 set will be instantiated but paging functionality unustable 4. set instantiated but record list will be truncated

4 instantiating a standardsetcontroller with a list of more than 10k records doesnt throw an exception. instead, the recordllist is truncated to allowable limit. on the other hand, instantiating standardsetcontroller using a query locater returning more than 10k records causes a limit exception to be thrown.

a dev needs to initialize a numverical value of 17. what data type should the dev use. 1 blob 2 string 3 numeric 4 integer

4 integer is a 32 bit number without a decimal point. using string will lose the numeric value of 17, so it may not be used in math operations

to fulfill a business requirement, a formula field of a child object has been used in a rollup summary field of a master object. will the rollup summary field function correctly 1yes, only if the formula field has a numeric value 2no, using the formula fields in a orllup summary is not ssupported 3 yes, using formula fields in a rolup summary is fully supported 4yes, if the formula field is not referring to another field in a different object

4 rollup summary field can calculate the value of the formula field unless -the formula field contains cross object field references -the formula field contains functoins that derive values dynamically such as NOW, TODAY number, currency, percent, date, date/time fields are available depending on the rollup type

if a dev is required to create a page that will show and add actions on a set of records, what controller can accomplish this with the least effore? 1. custom controller 2. lightning bundle controller 3. standard controller 4. standard list controller

4. Standard list controllers allow devs to create visulforce pages that can display or act on a set of records. standard list controllers cna be represented by adding recordsetvar tag on <apex;page>. Alternatively, dev can use custom list controllers, which are similair to standard but require coding in a custom controller or extension standard controller is designed for working on one primary record at a time. theres no such entity as lightning bundle controller, although there is a lightning controller in a a lightning comonent bundle. neither a lightning controller nor a custom controller have predefined or built in functionality for handling a set of records.

An organization's Chief Technology Officer is concerned about the use of third-party images in Visualforce pages due to recent reports from business partners about images stealing usernames and passwords. Which function can a developer use to securely fetch images that are outside an org's server and prevent them from requesting user credentials? 1. HTTPS 2. IMAGEURL 3. URLFOR 4. IMAGEPROXYURL

4. THIS FUNCTION imageproxy url allows secure retrieval of external images and prevents unauthorized requests for user credentials. it can be used on the src attrivute of a <img> tag or the value attribute of <apex:image> object

what trigger variable outputs the context of the current dml operation? 1. Tigger.dmlContext 2. Tigger.operationContext 3. Tigger.dmlType 4. Tigger.operationType

4. The Trigger.operationType is a trigger variable that returns the context of the executing DML operation. The available context values are BEFORE_INSERT, BEFORE_UPDATE, BEFORE_DELETE,AFTER_INSERT, AFTER_UPDATE, AFTER_DELETE, and AFTER_UNDELETE. Trigger.dmlType, Trigger.operationContext and Trigger.dmlContext are invalid attributes.

dev needs to declare and initialize a variable as constant. how cna this be met 1. use private 2. use transient 3 use this 4 use final

4. constants can be defined using the final keyword on initialization

how can a dev check the max number of digits in an integer field 1. use the getSize() method of the describeFieldResult Class 2. use the getLength() method of the describeFieldResult Class 3. use the getScale() method of the describeFieldResult Class 4. use the getDigits() method of the describeFieldResult Class

4. getDigits() returns the max number of specified digits for the field this is only valid with integer fields

Preferred way to reference web content-such as images, stylesheets. Javascript, and other libraries, that is used in Visualforce pages>? 1. by uploading the content to the docsuments tab 2. by accessing the content from third party CDN 3. by accessing the content from Chatter files 4. by uploading the content as a static resource

4. static resources allow you to upload content that you can reference in a VF page

Which of these is a standard controller operation that aborts an edit operation 1. save 2. close 3. delete 4. cancel

4. after cancel finishes aborting, the cancel action returns the user to the page where the edit was orig. invoked

universal containers would like to see red/yellow/green traffic light representation on the opportunity detail page based on the value in the opp probabilituy field. what would you use to achieve this 1 rich text field 2 image field 3 master detail relationship 4 formula field

4. an image (stored in documents) can be displayed conditionally using a formula field using the IMAGE()function

how many records can be processed by a SOQL for loop at a time

A soql for loop can be used to process records one at a time using an SObject variable, or in batches of 200 sObjects at a time using sobject list

Record types have been defined on the Account object. What does this mean? A. Different picklist values can be defined for each record type B. Different fields can be defined for each record type C. Different page layouts can be assigned for each record type D. Different users can be assigned to each record type

A,C record types allow a different set of picklist values to be defined per record type, as well as diff page layouts. record types are assigned to profiles not users

What is the name of the default public group to which all users are added?

All internal Users (contains all internal users in your org excluding partner portal and community users

The customer service depo recieves emails from their website users containing attatchments such as images or documents. A multiple-step process is invovled where the agents have to manuall download and then upload the attatchments to their related cases in their orgs. The department is asking if there is a way to improve the process.

An apex class can be built that extends the Messaging.inboundEmailHandler interface. This enables the lclass to handle inbound email and store the contents and attathcments of an email message in an email message in an object called InboundEmail. Having access to this object through the class enables automating the upload process by retrieving any email attachment and uploading to the related case such that it skips the entire manual work.

A growing logistics company handles shipping and delivery for several premium clients. As all their orders are stored and tracked in their CRM, they asked a salesforce consultant to make available a web service that would return information and status of orders as one of the initial cabalities. This allows their clients to integrate with their system and be able to automate order status enquiries amoung other possibilities/

An apex class can be exposed as a web service. In order to achieve this, the class must be exposedas global, and its methods as global static. The class, for example, is annotated with @RestRecouse(URLStatus='/OrderStatus/'). A method annotated with *@HTTPGet* can be used to fetch and return an order based on an ID passed via the paramater

A salesperson wants to track customer preferences and product interests. How can the data structure required be achieved in salesforce as per the MVC model 1.creating objects and fields 2. validation rules 3.workflow 4.create custom visualforce page

Answer: 1 in SF the data structure can be defined with objects and fields and sits in the model part of the mVC model

BC apex runs in a multitenant environment, the Apex runtime engine enforces limits to ensure that Apex code or processes don;t monopolize shared resources. What are valid exmaples of these limits? 1. CPU time per transaction 2. total number of records retrived by SOQL queries 3. Time executing a Soql query 4. maximum execution time for a DML operation 5. MAx number fo records that can be stored

Answers: 1,2,3 The runtime enforces limits of how long a soql query can run, how many records can be returned in a query, and max amt of cpu time a transaction can take. The max number of records that can be stored in an object depends on the storage available and is not subject to gov limits. Unlike SOQL querys, there is no max execution time for a dml stmt. There is, however, a limit for the total number of dml stmts that can be executed in an apex transaction

How cann css be added to a lighning component bundle

BY clicking on the style button in the developer console sidebaer

If multiple people in your organization work with an account, how can this be easily tracked and required access provided? A. Use Sharing Rules B. Use Account Assignment Rules C. Use Account Teams D. Use Multiple Owners

C an account team can be created for an account where team members can e assigned individual roles and access levels to the record including its related opportunities and cases. sharing rules are used to provide users with specified access levels to records and meet defined criteria. account assgnment rules are part of territory mngmt and are not used to track teams working on the same acct and provide required acces. an acct record can only have a single owner

"Stock Symbol" is a custom field on the Account object. What is the best way to make this field appear on Contact detail page layout? Choose 1 answer. A. Roll up summary field B. Lookup field C. Formula Field D. Parent Field E. Requires Apex Code

C formula field formula fields allow inserting references to fields of a parent object, in this case, account.stock_symbol__c

Which formula field function can be used to return the conversion rate to the correct currency for a given currency ISO code

CURRENCYRATE

when creating a new sandbox, what can a developer do to copy data and metadata from an existing sandbox

Clone the existing sandbox

Which functions used in Sqol count as one query row towoard gov limit for the ottal number of rows that can be retrieved

Count() and Count(fieldname)

What can be done with visualforce ?

Create Pages with custom look and feel Visualforce is web development framework that kets you build custom UI's for mobile and desktop apps that are hosted on lightning platform

The sales management team hires a new intern. The intern is not allowed to view Opportunities, but needs to see the most recent closed date of all child opportunities when viewing an account record. What would a developer do to meet all these reuirements? A. create a trigger on the account object that queries the Close Date of the most recent Opportunities B. Create a Workflow Rule on the Opportunity object that updates a field on the parent acocount C. Create a formula field on the Account object that performs a MAX on the Opportunity Close Date Field D. Create a roll up summary field on the Account object that performs a MAX on the Opportunitty Close Date Field

D

Which object is returned by EventBus.publish() method

Database.saveresult

Date declaration(initialization)

Date bDay= date.newinstance(year, month, day); date.newInstance(1998, 2, 22);

Which data type stores date and time

DateTime

Date-time declaration (initialization)

DateTime bDay= dateTime.newinstance(year, month, day, hour, minute, second); date.newInstance(1998, 2, 22, 12, 30, 56)

What platform features are part of the control layer in the MVC

Declarative (ie workflow or escalation rules) or programmatic (ie visualforce pages or apex classes) business logic

Which type of loop should be used when the coe block needs to be executed at least once

Do-while loop

When setting up validation rule, you must write the error condition formula and the __________

Error Mesage Error condition formula and error message is mandatory for validation rule Ex: account name is a required field

Which communication model is used by the ligtning component framework

Event-driven model

Which clause is used to specify the word or phrase to serach for in SOSL

FIND

Change sets can be used to move data and metadata from one org to another, T/F?

False change sets contain information about the org, but the y dont contain data, such as records change sets are used to send customization info from one org to another, but not actual data

In a master detail relationship, the parent field on the child record can be optional, t/f?

False parent field is required and when you delete the parent field the child field will also be deleted

which method can utilize a soql query to retrieve data for display on a visualforce page

GET getter method

which function can be used to securely retrieve 3RD party images on visualforce page

IMAGEPROXYURL

in what ways can visualforce page be embeded

In page layout and on lightning pages using visualforce components

which keyword can be used to allow apex to run in the sharing mode of the class that called it

Inherited sharing

Which data types are supported by switch stmt expressions

Integer, long, Enum, SObject, String

Multiple apex classes have been created that will be invoked in flows. Each class contains an invokeable method which is designed to work with a specific SObject such as acct, contact, etc. Although the SObject type handled in each invcable method is different, the business logic is the same. This resulted to repeated code in diff classes.

Invocable methods and invocable variables support SObject types. Instead of maintiang one class for each type, one apex class can be used to handle multiple objects bymodifying code to hadnle SObjects instead of a specific object type. The type of object can then be defined for each flow that uses the invocable method. This way, only one apex class is reuired and maintained.

Which function encodes text and merge field variable by inserting escape characters before unsafe javascript character

JSENCODE

Which UI framework allows building single page web apps with dynamic and reponses User interfaces in salesfoce

Lighnting component framework

in apex code, which class should be used to output debug messages for gov limits to determine if or when the code is about to exceed any governer limtis

Limit's Class

Name 2 considerations a salesforce developer should be aware of

Limits enforced on shared resources and test coverage must be achieved b4 deploument

What can be done with Bulk API

Load large amounts of data into the system bulk api is based on REST principals and is optimized for loading or deleting large sets of data. Used to query, queryall, insert, update, upsert, or delete many records Async. by submitting batches

which primitive data type stores 64 bit number without decimal pointq

Long

which type of collection can be used to store key-value pairs

MAP

limitations of a roll up summary field?

Max 25 of roll up fields per object, cannot be used with lookups, can't rollup a autonumber or cross object formula field

What part of the MVC include salesforce objects

Model

CAN CUSTOM OBJECT BE THE MASTER IN MASTER DETAIL REL?

NO, unless detail is also custom obj

different log levels in apex

NONE, ERROR, WARN, INFO, DEBUG, FINE, FINER, FINEST

Which optional clause can be used to arrange records in ascending or descending order in SOSL and SOQL

ORDERBY

Workflow can start___ When what it can do

On update or insert/create immmediately or delayed- ___gours/days after/before-date field on object update record fields, parent fields, create task, send email, send outbound message

WHICH TYPE of user can be traced using a debug log to track data that is synchronied using the salesforce integration cloud

PLAtform integratoin user

which declaritive and prorammatic features in salesforce can be used ot publish a platform event message

PROCESSES, FLOWS, AND AEPX

What is security like in lookup relationship?

Parent and child objects have independant security, sharing settings, and owner field

which exception is thrown when there is an eror related to a query

Queryexception

What can you use to limit available pick-list options? Page Layouts Record Types Field Level Security Profiles

Record Types You can limit picklist options by adding a subset of master picklist values to record type

Where should a visualforce tab be added to to make it available to salesofrce mobile app users

Salesforce mobile app navigation menu

which complex data type supports unique elemts.

Set

Simple vs complex What to Use: create a record from email?

Simp: configure email-to-case comp: apex email handler

Simple vs complex What to Use: automatically create a record?

Simple: Process Complex:Process calls flow or apex trigger

Simple vs complex What to Use: automatically delete a record?

Simple: flow complex: trigger

Simple vs complex What to Use: automatically update a record?

Simpole: process complex: apex trig r prcoess calls flow

An apex class has been created as part of an orgs maintenance process that deletes certain records when a criteria is met. The salesforce admin would like to modify the deletion criteria whenever necessary.

Since flows are capable of deleting records, the deletion criteria and deletion can be handled in a flow. This allows the criteria to be modified in flow builder and avoids the need to use code. The Apex then invokes the flow at the required point during the maintenance process

what can be used to acess a block of apex code by evaluating and matching an expression against certain unique vlaues specified by the developer

Switch statement

If you modify a schema, releated aoex code needs to be uodated? T/F

T

With metadata api you can move configuration changes bt sandbox and production environmnt, T/F?

TRUE With metadata API, you can Export customizations in your org as XML metadata files Migrate configuration changes bt organizations modify existing customization in your org using xml metadata files manage customizations in your org programmatically

Which statement would a developer use when creating a test dataset for products and pricebooks?

Test.getStandardPricebookId();

A sales director has requested an automation process that automatically converts a lead into an account and contact when the rating of the lead is updated to a certain value

The leadConvert apex class can be used to convert the lead into the acct and contact. It can also be used to convert the lead into a person acct and business acct simultaneously if the org meets the necesary configuration. A process can be created to invoke the apex method for the lead conversion when the record is updated and criteria is met.

What is required to overide a tab home page with a visualforce home page

The vF page must use standard list controller, custom controller, or no controller

A salesforce org over the years has accumulated a number of old records that can already be deleted. The head of operations is asking the saleforce developers to design and set up a maintenance routine for the org which needs to be run automatically on a periodic basis from this point onward.

To achieve this requirement an apex class in the form for a scheduled job can be run to delete records that meet criteria and handle other necesary preceedures involved in the maintenance rocess. To schedule an apex class to run at predefined intervals. It can implement the @Scheduleable interface. After that, it cna then be scheduled in the scheduled jobs page in setup or programmatically using the system.schedule method.

A multi national company manages an org with millions of recrods and hundereds of users. who access the platform on a daily basis. The salesforce administrator needs to run a process for opportuninty reocrds in the org. It will assess and identify what needs to be done to the record such as to archive or keep the record, reassaing to another user, or update certain fields such as type, close dates, etc. hwot odo this

To avoid hitting governer limits, batch apex can be used to run the process. It is capable of processeing thousands/millions of records. Every transaction in batch apex starts with a new set of governer limits. Also, when a batch transaction fails, all other succesful batch transactions will not be rolled back. Batch apex is an Apex class that implements Databse.Bathcable interface.

Limit on number of custom fields per object depends on the salesforce edition

True Per edition Group edition-50 proffesional edition-100 enterprise-500 unlim-500

which tools are available to access functionality provided by metadata api

VSC and ant migration tool

which ide (integrated development envirnoment) should be used to create and edit apex code, manage development projects, and migrate metadata componnets from one org to another

VSC visual studio code

Pages and components are what part of the MVC? Model View Controller

View

which automation tools can have a time delay to start actions?

Workflow and process builder can have scheduled actions. A flow can delay an action by pausing and resuming the flow based on a time/date or when a platform even is recieved.

how is a transaction defined

a code execution unit that is treated as one for gov limit pupouses

What can be done to display a custom UI that allows users to update several related records simultaneously on the opportunity page in the lighnting eperinece?

a custom lighning page can be created and added to the record page using lghnting app builder

what is a scratch org

a dedicated, configurable, and short term SF envirnment

what is required to use change sets in 2 orgs

a deployment connectino etween the orgs and each org must otherize the other to send change sets to it

What automation process can accept user input.

a flow can be used to accept user input in one or more linked screens, like a wizard

What is a self relationship?

a lookup field to the same object

best practice ot avoid exceeding heap limit

a soql for loop should be used to to process multiple bathes of the resulting records through the use of internal calls to qurey and querymore

Which Trigger event allows a developer to update a field in the Trigger.New list without using an additional DML statement ? (may be more than one) a. Before insert b. before update c. after update d. after insert

a,b trigger.newisreadonlyinaftertrigs

Which method can be used in a custom controller to respond to user input on a visual force page

action method

which unit tests are run by default for deployment to production

all local unit tests

examples of govverner limits

amount of memory allocated, cpu time used, umber of queries executed, number of records returned form a query

What can prevent visualforce page from using anticsfr token>?

an action handler in apex:page

Difference between managed and unmanaged package

an managed package is protected, upgradeable, and typically listed on the appexchange. unmanaged package are not protected, and can be used for distribution to tohers and can be a=edited once installed

Which of the following best describes the lightning componenet framework'' 1 it requires the Aura Components model to build lightning components 2. it automatically upgrades all pre existing VF pages and components 3 it is device aware and supports cross browser compatibility 4 it has event friven architeture

answer 3,4 Lightning Component uses an event driven architecture for better deoupling bt componenets. Any component can subscribe to an application event, or to a component event they can see. The lightning componenet framework supports the latest browser tech such as html5, css3, and touch events and includes responsive comments

select valid use cases for declaritive customizations 1. calculating sales tax applicable to a quote that is a complex calculation based on factors such as product, state, and quantity 2. calculating number of days until opportunity clsoes and displaying the value on a report 3. displaying total discount amount on an opportunity using rollup summary field based on line item formula fields which reference another object 4. determining a lead rating based on value of 3 fields on the lead record 5. displaying the number of employees of the acct related to an opportunity on the opportunity page layout

answer: 2,4,5 the NumberOfEmployees field on the account object can be displayed in the related opportnuity object using cross-object formula field. The TODAY() function and an opp CloseDate field can be used in a formula to determine the number of days left leading to its closedate ina cutom field or row level formula field in a report. fields, functions, and operators can be sed in a formula to generate certain ouput such as lead rating a complex calculation that involves a nubmer of lookups would be too complex for a formula field and would need a programmatic solution. A flow could be used for a simple calculation but not when there is complex business logic involved. Cross object formula fields cannot be used in roll-up summary fields

eric was told that vf is part o mvc paradigm.in this context, what does mvc stand for 1. master control variable 2. master class variable 3. model variable controller 4. model view controller

answer: 4 VF uses the traditional model view controller paradigm, with the option to use autogenerated controllers fro database objects providing simple and tight integration with the databse

a currency field is automatically dassigned to what data type in apex long currecny decimal number

answer: decimal in apex, currecny fields are autoassinged to type decimal currecncy and number are invalid data types. long is a data type for 64 bit numbers and do not include a decimal point

what constitutes the model part in the MVC 1. standard pages 2. custom objects 3. VF pages 4. standard objects

answers: 2,4 the model component constitutes the elts that define the structure of the data. in the sf context, they are standard and custom objects

what haooens when a field whose value is not specified for an object in an apex class is made required?

apex throws an exception when executed

What can be used to update a custom field on an unrelated object whenver a new acct is created in salesforce can flow update parent/child/ec

apex trigger (process builder needs to be related)

Which platform ishou;d be used to decalratively create user interfaces

app cloud (salesforce platform)

which type of event is not subject to components heriarchical setup

application event

if master of master detail record is deleted, what happens to detail records?

auto deleted

which types of flows can be used with external objects

autolaunched and screen flows

which triggers are executed during the execution of a workflow rule that contains a field update in the save order of excution

before and after triggers

where are the related records in a list on the parent record, in master detail or lookup?

both

diff bt master detail and lookup relationshio:>

both allow one object to be related to many others, but in MD, the detail record wouldnt exist without th emaster

Which stmt cna be used to exit a while or for loop

break

approvals can start by/from when___ what it can do

button press, link, process builder, flow builder, apex immediately update record fields, parent fields, create task, send email, send outbound message

how can a flow hide unnecesary fields on a screenq

by using component visibility settings on sreen components

The Stage field of all related Opportunity records should be updated to [Closed Lost], when the associated Account record becomes Inactive. What could be used for this? A. flow builder B. Approval Process C. Process Builder D. Workflow rule

c process builder should be used to update related child records by using the update records action type in this scenario, a record triggered after save flow can be created that updates the related opportunity records after the account records is saved. However, a flow should only be used if the requirement is too complicated, or if the required functionality is not available in Process Builder. An approval process cannot be used to update child record. Also, corss object field updates are available for an objects parent record only under certiain conditions

what are some considerations when writing a trigger

can process automation tools be used instead, one trigger per object, ensure trigger is bulkified, understand execution context

A custom object reference in apex code ______ be deleted

cannot

WHAT ARE OPTIONS FOR MOVING METADAT BT ENVIRONMENTS

change sets, force.com migration tool, VSC, workbench, unmanaged packages

why would a a partial copy sandbox be used over a full copy

cheaper and can be refreshed more frequently (115 times a day), has data and file storage of 5 gb, so a tempelate can be used to define the data copied (up to 110k records)

which field types are suported for a platofrm event

checkbox, date, date/time, number, text, and text area long

what can be used to view objects in memory at a specific checkpoint and see other objects with references to them

checkpoint inspector

what happens to children in lookup relstionship when parent is deleted

children are also deleted, but this CAN be prevented

what are some restrictions of change sets

code must have 75 percent test coverage, not all metadata types are supported, the order of components deployed cannot be specified, cannot be used to rename or delete components

in the lightning component framework, which resource contains the markup definition for reusable components of an app

component

2 eveents suppported by aura components?

component and applocation events

which type of event is is more efficient ans should be preffered when an event needs to be handled within the containment heriarchy

component event

when troubleshooting processes, what is the significance of myVariable_current and myvariable_old

current is the value when the process was executed executes and old is the most recent previous value

What can be added to a console to display a visualforce page

custom console component to sidebar or footer

to display a list of opppotrunities related to the opportunities of an account on the same page, need to use

custom controller because standard controller cannot display related records 2 levels down

batch apex jobs must implement what interface

database.batchable interface

what are options for exporting code from a dev env

dataloader, workbench, reports, dataloader.io, ETL tools

what can be used to record database operations, system processes, and errors that occur when running unit tests

debug logs

where can debug mode be enaled for lightning components

debug mode in setup

What data type can e used to store this number 724.224? integer decimal long numeric

decimal INt and long can;t include decimal points, Numeric is an invalid data type

Which component in the lightning component bundle is used to expose attributes to the lightning app builder

design

which file must be created in order to delete metadat componenets

destructiveChanges.xml

Which salesforce feature provides a query editor for SOSL and SOQL

developer console

what developer tool can be sued to make changes effective immediately in an org without installing any software

developer console

Where can logs be viewed, downloaded, and deleted

developer console and setup

What can be used to create or delete tests that can be run together

developer console suite manager

What are unmanaged packages typcially used for

distributing free software, templates, and open source components

limits of data import wizard

doesn;t support all standard objects, can'tvload more than 5ok records, can't save mappings, can't export data

which variables can be decalred as a numerical value with dcimal points

double and decimal

which component can be used in an aura component for platfform event subscription

empApi component

what happens when gov limit on total stack depth exceeded (triggers)

exception thronw, changes made are rolled back

Scheduable apex classes must include what methods

execute ie global void execute(Schedulable context sc){ mybatchapex class mb = new MyBatchApexClass(); Database.executeBatch(mb) }

Which code is not stored in the metadata but can be compiled and executed

execute anonymous block

T/F in an after update trigger class, trigger.new is an editable list

false trigger. new becomes read only

A field designated as required, is only required when it is added to a user's page layout

false.true idk if it is required it must be on page layout

what is an external id

field with a unique id from a system outside of salesforce

What automation tool can be used to guide users through an interactive business process that allows uploading files?

flow

What tool would need to be used to automate deleting of records

flow process and workflow cannot delete

which automation tool can be used to create a process that allows users to insert an image from a screen

flow builder

What do you want to do when you have to find the max of multiple opportunitites, check a box on the max record, and email the record owner> flow builder workflow rule apex trigger forumala field

flow builder flow can launch when recod is saved and to qury opportunities, determoine if recrod is highest amnt, and update a field on the record. and action can be added to the flow for sending emails. apex trigger can [produce desired results, but best practice is to use declarititve solutoin when possible. workflow and formula cannot query all opp. records for evaulation

company wants when saving a records, a check is performed to determine if the apportunity is the highest value in the current year for all opps in the org. if so, a checkbox on the opp record should be marked and an email sent to the record owners manager. what sf feautre used 1apex trigger 2flow builder 3workflow rule 4formula field

flow can be launched when a record is saved and qury opportunities, determine if the record has highest amount, ad update fueld on the record that invoked it. an action elt can be added to the flow for sending emails. apex trigger can be used but not needed neither workflow rules nor formula fields can be used since the cant query all opp records for evaluation

what does einstein next best action rely on

flow, recomendation, strategy, and components

which exception method can be used to obtain an error messge

getMessage

what can be used to handle the logic for all possible trigger events on an object

handler class

what does each debug log contain

header, execution units, code units, log lines, and other log data

which relationship can be used on the suier object to ass. one user to another

heriarchical relationshp

what happens if a gov limit is exceeded in dml operations

if gov limit is raised, dml is rolled back

Which control flow stmt is used to execute a block of code only if a certain consdition is true

if/if-else statement

to schedule an apex class, the class must implement

implements schedulable

what happens if a trigger with a dml statement triggers itself

infiinite loop

Which code can be defined for HTML tags like in a regular HTML page

inline CSS code

Which DML operations result in the execution of events in the Save Order of Execution

insert update upsert

which environemtn is responsible ofr combingand migrating changes fromdifferent development environments

integrations environment

Which property of an object or field can be changed when it is being used in apex code

label

Which tool can be used to add custom lightning components to a page in lighnting eperience

lightning app builder

Which namespace has prebuilt aura components that can be used in apps

lightning namespace

what happens when total heap size gov limit is exceeded

limit is throwndml rolled back

Which relationship ensires that ownership of child records is not inhereted by the parent

lookup

which type of relationship used to ensure that the value of the fied related to the parent record is required on all child records

master detail

what can be accesed to view metadata types supportrd in the latest version of metadata api

metadata coverage report

What layer of model-view-controller paradigm are standard or custom objects associated with?

model

What ccan a change set be used for

moving metadat between related orgs ie from sandbox to porduciton org. It cannot be used for moving data`

Which visualforce overrides are available for lightning console apps

new, edit, view, tab, list, and clone can be overridden

diff bt a developer and developer pro sandbox

pro has higher storage limits, both have copy of production configuration and not data, both can be refereshed once a day

what automation tool can be used to create records

process builder and flow

Which of the following is not a sandbox type? 1. Professional 2. Full 3. Partial Data 4. Developer

proffesional

which class contains reusable code for test data creation

public test class utility aka testfactoy

which types of declarititve changes are impacted by the use of apex

renaming, deleting, or changing type of a field

Which design supported by the lightning component framework ensures compatibility with different devices

responsive design

what allows developer to run commands for executing soql queries and anonymous apex code in vsc

salesforce cli

when using vsc, what must be installed to create and edit apex, visualforce, lightning aura componets, and lightning web components

salesforce extension pack

Where can lightning components be made available

salesforce mobile app, lightning experience, and communities

Simple vs complex What to Use: generate a report?

simP; report builder comp: vizualforce with custom controller or custom lightning component

Simple vs complex What to Use: share a record?

simp: configure sharing rules, teams compx: flow builder, apex maaged sharing

Simple vs complex What to Use: schedule recurring job?

simp: flow comp: apex scheduler

Simple vs complex What to Use: validate a record?

simp: validation rule comp:apex trigger

Simple vs complex What to Use: call a web service?

simple: outbound message complex: custome apex web services

Simple vs complex What to Use: build a wizard to guide users

simple:flow complex: visualforce with custom controller, or sutom lighning componentn

which panel of the log inspector shows info ina top down manner from the innitiating call to the next level down

stack tree

which envirnment can e sued for a test deployment before changes are migrated to production

staging envirnoment

What are different type of lighnig components

standard, custom, and appexchange components

Which attribute of the <apex:page> component is used to associate a standard controller with a visualforce page

standardController

2 methods used to assign a new set of gov limits in tests

startTest() stoptest()

What should be used instead of dynamic soql to prevent soql injection?

static query with a bind variable

mthod to verify whether test achieves expected results

system.assert();

what cna be used to populate test data without using code to create test records

test.loadData with a static resource for the csv file containing test records

which method retrieves metadata for an object

the describeSObjects() method

Which two options are available to access the token for an object in apex

the getSObjectType() method and the sObjectType static member variable

Which object can check if an object cna be created by a user?

the isCreateable() method

What can be used to create test data once and use it for the rest of the test class

the testsetup annotation/method

Which keyword can be used to ensure that apex respects sharing permissions of the user that is logged in

the with shraing keyword

when to use standard set controller

to create custom list c\ontroller or extend standard list controller add features, such as custom sorting, not suppported by standard list controller

when to use standard list controller

to display list of records to listview filters on visualforce page create a visualforce page with pagination features

which api provides fine-grined acces to an org's metadata by retirveing smaller pieces of metadat

tooling api

limit on total stack depth

total stack depth allowed for recursive apex triggers that are envoked bc of insert, upate, delete stmts is 16

what happens when exceed Gov limits on DML stmt

transcation is terminated and no records are inserted dml operations rolled back

t/f it is not possible to roll up smmarize autonumber fields

true

Which 3 possible values can be assigned to a boolean variable

true, false, null

which blocks are used for exception handling in apex

try, cathc, and finally

what can be used for distributing metadat to multiple unrelated orgs

unmanaged packages

Which DML statement can be used to either insert new records or update existing records in a single cell

upsert, learn about it pal

What type of tests are conducted in a UAT environemt

user acceptance tests

what needs to be set up to generate debug logs when users perform actions in salesforce, such as updating records

user trace flag

how does salesforce track how a deal progresses through the sales cycle using sales status using deal stages using opportunity stages using opp staatus

using opp stages in salesforce, an opp moves through a series of defined stafges withing a sales process. the stages are linked to the type of tasks being performed and how likely it is that the sale will be made. ecample stages include prospecting, developing, negotiation/review, closed/won, closed/lost

In salesforce DX, what is the source of truth

version control system

What SF feautire should be used to build dynamic pdf documents

visualforce page

When would creating a formula field be appropriate?

when a red only value is required that is calculated by the value of fields (including fields in related records) or based on a defined formula

what is a full copyy sandbox used for

when an environemnt that is identical to production is required for performance, load, regression, or UAT testing

When to use standard controller

when visualforce page requires basic functionality when standard actions do not need to be customized

Default sharing mode for execute anonymous block

with sharing

whats the default data access setting of Apex class?

without sharing

wHICH SET of tools can be used to query, delete, update, and insert data into salesforce via the force.com api

workbench

How can you prevent an encrypet file from being edited? (Multiple answers)

yOU CAN PREVENT THE EDTing of an encrypted field by setting validation rules field level security page layout settings

can relationship types be changed?

yes, a master detail relatioshjip field can be converted to a lookup rel and vice versa, but the lookup field must have all values in records, parent of MD can't have rollup

what should you use to transfer metada in a scripted manner to multiple environemtns

force.com migration tool can be used to script deployement to multiple environments

what can be created and executed using salesforce testing framework to enure error free code

unit tests

a company wants to use the lightning component framework for adding functionality that allows the companies users to manage its transportation service. a developer has been asked to work on a few custom lightning web components that will be added to lightning pages and tabs. which of the following is an important consideration for this use case 1 a component bundle containing controller and css would need to be defined for each lightning web component 2 My Domain will need to be deployed for adding the components to lightning web pages and tabs 3 the lightning component framework allows only aura components to be added to lightning tabs 4 each lightning web component should be inside an aura component to configure it using lightning app builder

answer 2: the lightning component framework allows both aura and lightning web components to be added to lightning pages and tabs. However, My Domain needs to be deployed if lightning components need to be used in lightning tabs, lightning pages, standalone apps, as actions and action overrides, as custom lightning page templates, or elsewhere in org. a component bundle can only be defined for an aura component. each lightning web component that renders ui consists of an html file, a javascript file, and a metadata configuration file. a lwc doesnt need to be inside an aura component in order to configure it using lightning app builder.

Which are valid reasons for considering an appexchange app? 1.many appexchange apps include support for salesforce mobile app 2.an existing app may solve the busniess problem, meaning a custom solution need not be developer 3. an existing unmanaged package app may meet most of the requirements and can be furthere customized 4. all app exchange apps are free 5.appexhcnage apps will not affect organiztion limits

answer: 1,2,3 salesforce apps and components can be configured explicitly to support either desktop or phone only, or both, by specifying their supported form factors. While many appexchange apps are free, the majority of apps require purchasing. Apps can either me managed or unmanaged packages, and overall limits are affected in diff. ways depending on the type of package

which keywords is used by a class to use an interface

implements

controller extension when to use

to extend or overrid standard controller add a custom button to a page build a page that respects users permissions

What does not affect actual data after succesful code execution

unit tests

how can values on a record about to be saved be accessed and modified

using trigger.new context variable

What does the UI display when a user tries to change the data type of a field that isreferenced in Apex code?

validation error

which stmt about do-while loops are true? 1. the do while stmt evaluates its expressoin at the top of loop instead of bottom 2. the while stmt continually executes a block of stmts while a particular condition is true 3. the stmts within the do block are always executed at least once 4. a dev can implement an infinited loop using the while stmt 5. soql query limits are NOT enforced during the first itertoin of a do while loop

,2,3,4 the apex do while loop doesnt check the boolean condition stmt until after the first loop is executed. therefore, it evaluates its expression at the bottom. on the contrary, the while stmt evaluated its expression at the top. soql query limits are always enforced, regardless of the code block they appear in.

An Apex trigger is subscribed to a platform event and generates invoice records upon receiving published event messages from an external order management system. However, an issue has been found on the record creation, and the Apex trigger needs to be modified. It is required that no published event messages should be lost while the Apex trigger is being fixed. What should be done to fix the Apex trigger? 1. suspend the subscription of the apex trigger to the platform event 2. schedule recieving platform event messages at a later time 3 store any published event messages in a cutom object temporairly 4. deactivat the apex trigger and pause publishing of event messages

1 the apex trigger needs to stop executing to prevent further issues in the org without losing any published event messages. to acheive this, the subscription of the trigger to the platform event can be suspended, which in this state, does not invoke the trigger to process any published messages. the subscription can be resumed ti start at the earliest unprocesed mesaeg or at new event messages only deactivating trigger or storing published in temp object not required. pausing the publihsing of event messages not required may not be feasible. scheduling recipt of platform event messages not possiblee\.

how can dev check to see if current user is able to delete current object 1 use the isdeleteable() method of the DescribeSObjectResult Class 2use the Deleteable method of the SObjectResult Class 3. use the canDelete() method of the SObjectResult Class 4 use the canDelete() method of the DescribeSobjectResult class

1 the isDeleteable method of the descirbeSoobjectResult class returns T if the object can be deleeted by the current user, F otherwise. other usefule methods of descirbesobjectResult include isAccessible(), isCreateable,IsSearchable() and more.

Which iteration component can be used to display a table of data with platform styling

<apex: pageBlockTable>

Cosmic Finance Solutions has recently switched to Lightning Experience. The Salesforce Administrator of the company would like to make use of Lightning components to enhance the user experience. Which of the following can be created using the Lightning App Builder? 1 custom page layouts 2 custom record pages 3single page apps 4 customcustom home pages 5lightning tabs

2, 3,4 App pages, record pages, home pages, and email application panes can be built using Lightning App Builder. Page layouts can be created in the Object Manager page of an object. Lightning tabs can be created in the Tabs page in Setup.

which of the following requirements coulda dev use a formula field for 1 concatenating field values from long text area fields or description fields 2 creating a link to an app outside of sf, passing params including the session id 3displaying a traffic light image of red, yellow, green, based on case priority 4calcualting a value based on other value and merge fields

2,3 a formula field can return an image by using the IMAGE function. a formula field can also return a link with the session id as a paramater by using the HYPERLINK ans GETSESSIONID fucntion formula fields do not support long/rich/encrypted text area fields. custom formula fields are not available in connect offline, web to lead forms, or web to case forms

what are implications of using an external id to relate child records to parent records 1relating records using an external id only works for inserts and not upserts/updates 2child record must have a relationship field that assoc. it to the parent record. 3 a parent record reference is created and added to the relationship field on the child record 4an external id field must also be defined at the child record to establish the relationship

2,3 an external id field can be used to assoc records instead of the usual record ids. when relating records using this approach, the child object must have existing relationship field to the parent object such as a lookup or master detail relationship.this relationship field is where the parent record reference is added and establishes the association bt 2 records

which are valid apex variables 1. number x; 2, string a,b,c; 3. currency abc; 4. map<Id, string> samplemap; 5. boolean y;

2,4,5 currency is not a valid apex data type. instead, decimal is used. number is not valid dat type. integer, long, decimal, and double are primitive data types available in apex when working with nubmers.

a method that is currently only accessible within a class needs to be exposed to another class that extends from it. which is right 1. protected static void method(){...} 2. protected void method(){...} 3. protected inner void method(){...} 4. private void method(){...}

2. the protected keyword enables a method to be visible to inner classes of the apex class it is defined in as well as extensions of that class. ccannot be static and is only allowed on instance methods and member vars. the inner kw doesnt exist. provate void is valid, but only allows the method to be seen inside the class it is defined

What is true regarding person accounts? 1. person accounts have the same fields as business accounts 2. once person accounts are enaled they cant be disabled 3. if person accts are enabled, when creatin an account, the type of account created needs to be selected 4. person accounts do not have an account hierarchy

3,4,5 person accounts once enabled cant be disabled. When creating new acct, the type of acct must be selected. the fields of a person acct are made up of fields from the acct and contact objects

Max number of lookup fields for a single object?

25

what is true regarding record access ina master detail relationship 1the detail object can have its own sharing rules 2the record owner can be changed on the detail object 3the owner of a master record is autom. used to set the woner of its ass. detail records 4the detail object inherits the sharing and securtiy settings of the masterrecord

3,4 The Owner field on the detail object is not available and is automatically set to the owner of its associated master record. Custom objects on the detail side of a master-detail relationship cannot have sharing rules, manual sharing, or queues, as these require the Owner field. The detail record inherits the sharing and security settings of its master record.

a junior dev frequently experiences gov limit errors when running apex triggers. which of the foloowing are best practives that a senior developer could advise 1. use a seperste apex trigger for each trigger event type 2. use soql queries only within for loops 3 use lists to perform dml operations on multiple records 4 use collection data types and streamlined queries

3,4 Utilizing collection variables such as lists, maps, or sets to store data obtained from queries is a fundamental technique that is used to make Apex code more efficient. A SOQL query can make use of the WHERE clause to query all the data required in Apex code. Instead of using DML statements inside FOR loops to perform operations such as insert, update, or delete on individual records, they should be executed using collections outside FOR loops. Also, a SOQL query should never be placed within a FOR loop since there is a governor limit that enforces the maximum number of SOQL queries in an Apex transaction. There is another limit that enforces the maximum number of DML statements allowed in a transaction. It is recommended to only have a single Apex trigger for each object, and in addition to that, implement a helper class to handle the logic that occurs in the trigger.

select when to use process builder instead of workflow rules 1. field update on parent object 2. creating tasks at multilpe intervels 3. copying the account postal code to all child contacts 4. submitting an order for approval

3,4 both are capable of creating task records at multiple intervals (ie after 7 days..) a workflow rule and process can both update fields on a parent (master detail is required for workfloww rules) between the two, only a process can submit a record for aproval and update child records.

Using the sample controller class below, what is the value of the count variable when the following script is run? MyController ctrl=new MyController(); ctrl.logCount(); ===== code start ===== public class MyController { public Integer count { get { if (count == null) { System.debug(\'set count\'); count = 10; } else { System.debug(\'increment count\'); count++; } return count; } private set; } public MyController() { System.debug(\'constructor begins\'); if (count == null) { count = 20; } System.debug(\'constructor ends\'); } public void logCount() { System.debug(\'The value of count is \' + count); } } 1. 20 2. 10 3. 11 4. 21

3. 11 in the constructor, when the if statement reads the count variable, the get pproperty of the var is called before the conditional block starts the evaluation. in the get propertty, count would have been null so its val is set to 10 and returned. the value is then recieved back into the if statement and since its been set to 20, it will not satisfy the condition during the evaluation.when the count var is referenced by the logCount method, the get property is called again but this time the value will be incremented since it no longer contains a null value.

a developer created a custom object named project. data from assoc. projects needs to be summarized on each acct. all assoc projects should be deleted when an account is deleted. how to do this 1lookup relatopnship field on account 2master detail rel field on account 3 lookup rel. field onproject 4 master detail rel field on project

4 pmlementing a masterdetail relationship bt objects automatically deletes the child when the parent is deleted. the relatoinship is established by crreating a master detail field on the detail/child object

what does the trigger.new context variable contain 1. a map of sobject ids and recirds that are new or modifed and available in insert and update triggers 2 a list of new records and is available only in insert triggers 3 a set of new versions of records available in insert and update triggers 4. a list of new versions of records and avail in insert, update, and undelete triggers

4 trigger.new contains a list of new versions of sobject records and avail in insert, update, and undelete triggers

in an updated trigger, how can a list of the previous versions of the records be accessed? 1. by accessing the trigger.previous context variable 2. by oaacesing trigger.oldList context variable 3. by accesing trigger.updated context variable 4 by accesing trigger.Old context variable

4 trigger.old returns a list of the old versions of the sobjects records. this list is only available in update and delete triggers

you need to rate all accounts daily based on the values of the opps closed in the current year, number of open opps, and opp close rates. the acct with the highest aggregates result should be rated number 1, and so on until the account with the lowest rating is updated. how can this be done 1use process builder and schedule an action to run each nioght to sort and rate all accts 2use an apex trigger on the acct object and schedule it to run each night 3use a time dependent workflow action to update the rating field 4use batch apex and schedule it to run each night

4 process builder, workflw rules, or tirggers cant be configured to run periodically or at fixed timing sor intervals, nor can processes or workflows perform complex calculations. a scheduled apex would be suitable for this requirement since it can be set to run at regular intervals and perform the required logic. note that autolaunched flows can also be scheduled, but if the logic is too complex, apex should be used. also, batch apex has much higher gov limits compared to scheduled flows. so batch apex can be sued to process al the acct records daily. an apex class that implememtns the database.batchable interfface can be created for the batch apex job. another apex class that implements the scheduleable interfce can be created to execute the bath apex job at regular intervals, the scheudleable apex page in the salesforce ui or the sytstem.schedulebale method can be used to specify the scheudle. the apex class defined for batch apex jobs must sue follwong syntax global class BatchApexClass implements Databse.Batchable{ global (database.quierylocater | Iterable<sObject>) start (Databse.BatchableContext bc){ //code global void execute (databse.batchablecontext bc, list<Sobject>) } global void finish(databse.batchablecontext bc){ } } the scheudlebale needs this syntax global class SchedulebableApexClass implements schedulebale{ global void execute(SchedulebaleContext sc){ batchapexclass b = new batchApexClass(); Database.execute(b); }

how many checkpoints cna be set in apex code at a time

5

what is correct in respect to the SF MVC paradigm? 1.components are part of mvc 2.standard pages are part of mvc 3.visualforce pages are part of mvc 4.custom objects are part of mvc 5.all are true

5 custom objects are part of the model, standard and vf pagesare part of view

percent of apex code that must be covered by tests before deployment

75

Which tag can be used to reference a javascript library uploaded as a static resource in .cmp markup

<Itng:require>

this code means serialization or deserialization is always allowed for any apex code not allowed

@JsonAccess(serializable='always')(never)

this code means serialization or deserialization is never allowed for any apex code

@JsonAccess(serializable='never')

a dev writes the following block of code in a data factory class but gets an error message when attempting to save the file. what is wrong with the code? Contact testC= new Contact(LastName='Smith', MailingAddress='115 Wilt Rd, Los Angeles, CA'); insert testC; 1. first name is required when creating new contact 2. address is missing a postal code 3. MailingAddress can't be directly modified 4. Contact doesn't contain a MailingAddress field

Address fields on standard objects are compounded data types and cannot be directly modified. Instead, each individual component of the Address field must be modified

Which page on salesforce UI allows unit class testing

Apex test Execution

which limit can be exceeded when a trigger is not designed to handle several thousand records?

Governer limit for DML statement per transaction

security of children and pparent in master detail?

SHARING AND SECURTY IS SHARED

What language is used to query Salesforce for specific information?

SOQL

There are several escape sequences that can be used in queries so that a user query can contain special characters. which of these are valid escape sequences 1. \a 2. \' 3. \" 4. \c

SOQL defines several escape sequences to include special characters in queries. It is possible to escape new lines, carriage returns, tabs, quotes, and more. The escape character for SOQl is the backslash character. The other 2 options are not valid

Name the language Force.com uses to support full-text search in Objects

SOSL

A Salesforce developer in Cosmic Solutions is writing an Apex method called "verifyAccountHierarchy" in her "AccountServices" class. She is using Process Builder to create a process for new and updated accounts that will invoke verifyAccountHierarchy. She needs to pass a parameter to the Apex method to allow the method to access the record that was updated and perform complex logic on related records (those records may not be directly related to the new or updated Account). Which of the following types could she use as a parameter value for the verifyAccountHierarchy method in Process Builder? 1. the flowdefinition object 2. the account sobject 3. the account id 4. trigger context variable

The Account sObject or Account ID could be used in parameters sent from Process Builder. In the Apex code, the parameter will be a List of Accounts or Ids (rather than a single Account or Id). The "verifyAccountHierarchy" method must be annotated with @InvocableMethod in order to be called from Process Builder. The FlowDefinition object is the native Salesforce structure that represents a Process or Flow, and this cannot be passed as a parameter to an Apex method, nor would it be useful to do so when updating or creating an Account.

A developer has a requirement to display a chart on the account page layout to help users visualize data. Which of the following statements is not true about how charts could be incorporated into a VisualForce page? a. A collection of standard components can be used to create VisualForce charts b. Javascript charting libraries can be used c. Google Charts can be integrated into VisualForce d. VisualForce charts will display in VisualForce pages rendered as PDF

a,b,c Visualforce charting uses javascript to draw the charts. They won't be rendered as PDf's

what are requirements for for a class definition

access modifier, name of class, class keyword

What is a valid consideration regarding development in a multitenat environment 1. SF upgrades are automatic and cannot be scheduled on a particular date 2. SF orgs can choose to accept upgrades, so different orginizations may be on different releasesd 3. sf upgrades sandbox environments at the same time as production envirnoments 4. although sf runs in the cloud, client software is still required

answer: 1 SF updates automatically 3 times a year and cannot be scheduled. No client software is reuired, apart form a browser to access the internet. Sandboxes are upgraded prior to production environments so that changes can be previewd and tested

a company would like users go be able to enter policy and advisor details on a screen. When a user clicks the next button on the screen, the advisor commision related to the details entered by the user should be displayed on the next screen. what wpuld be the recommended solution 11create a visualforce wizard 2create a flow with flow builder 3create and approval workflow 4create a process with process builder

answer: 2 a flow can be used to create a wizard like interface where details can be entered on one screen and a calcualtion displayed on the next. visualforce isnt nesesary as the requirement can be made declaratively. process builder cant be sued for building interfaces

a developer is required to create a trigger that every timethe Type field on Request object is updated, the Owner field should be changed as well, either to a user or queue.. What trigger event should dev. use 1 before delete 2 after merge 3 before update 4 after update

before update can be used to update fields before the record is saved to the database after update triggers wont work because at this point, the record that invoked the trigger has already been saved to the database (but not yet commited) and becomes read only such that setting a value on a field will throw an exception. before delete triggers are used when deleting records and merge triggers dont exist

a developer needs to write a trigger on the survey custom object. this trigger will use the email address on the survey record as a unique key to look for a matching email address on the existing contact records. if a matching email addy is founf, then the surveys records name of contact field should be populated with the name of the contact found. what is best data type to use when storing contact records

c. a map is a collection of key-value pairs where each unique key mapsto a single calue. the dev can query the contact records in place them on a map with contact.email as a key and contact.name as a value. then, on survey record iteration, the dev uses the get method of the map to look for the corresponding contact.name for a given email address although a list data type helps to store a collection of email addresses, it will need to perform nested for loops to avoid unnecesary sowl queries. similair to a list, a set can also only hold one data type per instance. a group is an invalid collection data type

On what event should the trigger below be fired? Trigger createCallingCard on Contact (EVENT) { List<CallingCard__c> cardList = new List<CallingCard__c>(); for (Contact con : Trigger.new) { CallingCard__c newCard = new CallingCard__c(); newCard.Name = con.Name; newCard.Phone = con.Phone; newCard.Address = con.Address; newCard.relatedContact__c = con.Id; cardList.add(newCard); } insert cardList; } A. After Update B. Before Delete C. After Insert D. Before Insert

c. after insert the code snippet above shows that the contact id needs to be assigned to the relatedContact__c field of the callingCard custom object. in the save order of execution, record changes are saced to the database(but not yet commited) prior to the execution of after triggers. hene, the contact ids will be available for use in the after insert trigger. this also ensures that a contact record has been created prior to creating a counter callingcard record

which data type can store 726.23 Decimal Integer Numeric Long

decimal The Decimal data type is used for storing numbers that include a decimal point and is most suitable for working with currency values. Currency fields in sObjects are automatically assigned the type Decimal. Double is a 64-bit numeric data type that can be used to store numbers that contain decimal points but offers lesser functionality compared to Decimal. integer and long cannot include decimal points. Numeric is not real

In a bath apex class, the 3 methods that must be included are

start, execute, finish global (database.querylocator | iterable<SObject>) start(database.batchablecontext bc){} global void execute(database.batchablecontext bc, List<Sobject>) global void finish(database.batchablecontext bc){}

when to use custom controller

to implement total custom logic if page needs to use web services or HTTP callouts build a page that runs entirely on system mode create a page with new actions customize user navigation

Which of the following can be used to update existing standard and custom fields on child records when a parent record is modified process builder workflow ruels formula fields apex trigger

trigger and process builder Workflow rule ca only update the master record related to child, using cross object field update. A cross-object formula field can reference and display values in merge fields from a parent object if the object is in the detail side of master detail relitonship, it cant update existing fields on detail side.

T/F- an object has a rollup summary field on it, and has children. this relationship cannot be converted to a lookup realtionship

true lookup id needs to be populated on all records to give back to master

annotation for test methods

@istest

what exception method should the dev use to know the error message that displays for the user 1. getTypeName() 2. getMessage() 3. getCause() 4. getStackTraceString()

2. the getMessage method returns the error message that displays for the suer. the getCause method is used to return the cause of the exception as an exception object. the stacktrace method is then used to return the stack trace as a string. however, get typename method returns the type of exeption, such as DMLexceptino, ListException, etc

How can SOQL injection be prevented? A. Use the escapeSingleQuotes method B. Use the preventInjection method C. Use the preventQuotes method D. Use the preventDatabaseCommands method

A. Soql injection is a technique where a user causes the application to execute database methods that were not intended by passing soql stmts into code. this can occur in apex code wherever the appliation relies on end user input to construct dynamic soql stmts and the input is not handled properly. to prevent soql injection, the escapeSingleQuotes method must be used. this method adds the escape char \ to all single quote marks in a string that is passed in from the user. the method ensures that all single quote marks are treated as enclosing strings, instead of database commands

which formula would need to be defined in a formula field to add 6 months to a custom field named "contract_start_date__c"

ADDMONTHS(contract_start_date__c, 6)

there is a req to track which health carre providers are related to hospitals. hospitals and health care prov are custom object records. a health care prov should be related to multiple hospitals and hospitals shoudl be related to multiple health care providers. how to do this 1create an additional object to connect the other 2 objects and create 2 master detail rel fields on the obejct 2create 2 master detail rel fields, one on the health care prov object and one on hospital object 3 create a master detail rel field onhealth care provider object 4 create 2 lookup rel. filds, one on the health care provider object andf one on the hospital object

1 in this case, a many to many rel is needed an an additional junction object needs to be created to connect the other 2 objects. after crreating junction object, 2 m-d rel needs to be created onthe junction object to connect the other 2

In the following line of code, why can the helloWorld() method be called directly instead of instantiating the myClass? myClass.helloWorld('Hello'); 1. helloworld is a static method 2. helloworld is a void method 3. myclass is a static class 4. myClass is defined as public

1 A static method, which can be used as a utility method, is called without instantiating the class. The 'static' keyword can only be used with methods, variables, and initialization code, but not classes. The return type 'void' means that the method does not return a value. The 'public' keyword is an access modifier and only affects accessibility to the class for other code.

A Salesforce Administrator is replacing a spreadsheet that tracks company resources and the employees that are assigned to the resources with a Salesforce App. Resources can be of different types, such as phones, vehicles, and equipment. Each employee can be assigned multiple resources. Employee and resource records exist independently. A resource can only be assigned to one employee and is not shared. After creating a custom object for Employee and Resource, what type of relationship would be appropriate to create? 1lookup relationship 2many to many relationship 3master detail 4picklist relationship

1 As the objects can exist independently and do not have a close relationship, a lookup relationship is appropriate. An employee lookup field would be added to the resource record to allow one employee to be assigned to a resource.

Cosmic Luxio is a company that manufactures and sells luxury watches. Customers can purchase products from the company's website or by visiting an authorized retail store. Each retail store uses a custom web application for managing sales orders. The application supports making custom HTTP POST requests to external endpoints. Salesforce is used by the employees who work at the company's headquarters. When a new sales order is created by a retail store, certain users in Salesforce should be notified and a record of a custom object should be created automatically. A platform event with several custom fields has been defined by a developer for this use case. Which approach should be utilized to publish a platform event message using the custom web application for this requirement? 1. use rest api to send post request with a platform event message to a sf endpoint 2. use soap api to send post request with a platform event message to a sf endpoint 3. use flow to publish platform event message to event bus 4. use EMP Connector to create custom client that can publish platform event message to event bus.

1 In this scenario, since the external application supports making HTTP POST requests, REST API can be used to publish platform event messages. If 'Sales_Order_Event__e' is the name of the platform event associated with the creation of sales orders, a POST request can be sent to the following endpoint to publish an event message: /services/data/v48.0/sobjects/Sales_Order_Event__e/ In Salesforce, an Apex trigger or process can be used to subscribe to the platform event. When an event message is received, it can send an email to the users and create a record of a custom object automatically. In order to publish event messages using SOAP API, the create() call is used instead of a POST request. Flow is an automation tool in Salesforce that cannot be used to publish event messages from an external application. EMP Connector is used to subscribe to platform event messages.

Which of the following provides a dynamic environemnt for viewing and modifying objects and relationships 1 schema builder 2 process builder 3 approval vizualizer 4 flows 5 process vizualizer

1 Schema Builder provides a dynamic environment for viewing and modifying all the objects and relationships in your app. You can view your existing schema and interactively add new custom objects, custom fields, and relationships, simply by dragging and dropping.

Steadfast Insurance Inc. has a custom object Claim to track insurance claims for its team members. When a team member creates a claim record, an approval process is started which is used by the insurance manager to approve or reject the claim. In order to assist the manager, a team member's claim limit, which is a custom field on the User object, should be displayed on the claim record. What is the recommended solution to meet the requirement? 1 Use a cross-object formula to display the user's limit on the claim record 2 Use a trigger to populate the user limit field when the claim is created 3 Use a field update in a workflow rule to copy the team member's claim limit onto the claim record 4 Use Process Builder to populate the user limit field when the claim is created

1 Technically, all the options can be used to meet the requirement. However, using a cross-object formula is recommended as it is the most straightforward solution to achieve what is required. Cross-object formulas can reference fields on related records. In this case, the claim limit can be made available to the claim record by creating a cross-object formula through Claim > Owner (User) > Claim Limit. Relatively, more declarative customization work will be required for workflow rules or Process builder. An Apex trigger would not be required as a declarative option is available.

which of these is valid 1. public static boolean method (string param) 2static public boolean method (string param) 3boolean static publi method (string param) 4. public boolean static method (string param)

1 The proper syntax of declaring a method in Apex is [public | private | protected | global] [override] [static] return_data_type method_name(param_data_type1 param_name1, ...) where: An access modifier such as public, or private, is used but optional depending on the requirement. The override keyword can be added to the declaration to override methods in a class that have been defined as virtual or abstract. The static keyword can be used to enable the method to be called without instantiating the class. If the method returns a value, the data type of the returned value must be specified before the method name. Otherwise, the void keyword is used. Enclosed in parentheses, input parameters are separated by commas where each is preceded by its data type. If a method does not have parameters, an empty set of parentheses is used.

a developer is creating cutsom logic to act on a set of user selected records from a list. which method of standardsetcontroller can she use to determine which records the user has selected? 1. getselected() 2. getcheckerd() 3. getcheckedlist() 4getselection()

1 getselected() method returns a list of sobjects representing the selected records

A Salesforce developer has written the code block below that performs certain logic based on the type of field returned. The developer notices that when more values need to be compared, the block becomes harder to read and more code is being duplicated. Which is a suitable option to make the code more readable and at the same time reduce its size? Schema.DisplayType fieldType = fieldName.getDescribe().getType(); if (fieldType == DisplayType.String || fieldType == DisplayType.EncryptedString || fieldType == DisplayType.TextArea || fieldType == DisplayType.Combobox || fieldType == DisplayType.MultiPicklist || fieldType == DisplayType.Picklist) { // handle as string value } else if (fieldType == DisplayType.Integer || fieldType == DisplayType.Double || fieldType == DisplayType.Long || fieldType == DisplayType.Percent || fieldType == DisplayType.Currency) { // handle as numeric value } else if (fieldType == DisplayType.Date || fieldType == DisplayType.DateTime || fieldType == DisplayType.Time) { // handle as date/time value } else if (fieldType == DisplayType.Boolean) { // handle as boolean value } else { // handle as something else } 1 use a switch block w multiple values 2. create nested if else stmts 3 use switch block with single values 4split block into 2 diff stmts

1 the switch control flow stmt is capable of handling multiple calues in its when block as well as enum values by converting the if else stmt into this structure code bc easier to read. also, the var name doesnt need to be repeated which reduces code size using nested if else or splitting the code block to spearate if smts only breaks necesary logic and doesnt meet requirement. using switch with ingle values may increase readibility bu doesnt reduce code size

If there are account records named 'Express Logistics', 'Global Insurance' and 'Tyler Chemicals' in a Salesforce org, what will be the output returned by the System.debug method when the following Apex code is run? Integer c = [SELECT Count() FROM Account WHERE Name = 'Express Logistics' OR Name = 'Global Insurance' OR Name = 'Tyler Chemicals']; Integer r = Limits.getQueryRows(); System.debug('c = ' + c + ' and ' + 'r = ' + r); 1. c=3 and r=1 2. c=1 and r=1 3. c=1 and r=3 4. c=3 and r=3

1 this apex code uses the count function in a soql query. even though there are 3 records that are counted by the query, the query itself only couts as one row to gov limits. The getQueryRows() method of the Limits class returns the number of rows that have been returned by SOQL queries. Since there is only one query that counts as one query row due to the Count() function, the value '1' is returned by the method and assigned to the integer variable 'r'. Since there are three records that satisfy the conditions in the SOQL query, the value '3' is assigned to the integer variable 'c'.

What are 2 valid uses for controller extensions in visual force page? override the edit action of standard controller Add new action in visualforce page replace standard controller entirely sert any page to always run in system mode

1 and 2 controller extensions : You want to leverage the built-in functionality of a standard controller but override one or more actions, such as edit, view, save, or delete. You want to add new actions. You want to build a Visualforce page that respects user permissions. Although a controller extension class executes in system mode, if a controller extension extends a standard controller, the logic from the standard controller does not execute in system mode. Instead, it executes in user mode, in which permissions, field-level security, and sharing rules of the current user apply.

Global Insurance has custom objects to represent policies and claims. A policy can have zero or many claims. A claim is always related to a policy. Claims are first assigned to a queue and then later assigned to different members of the claims team. What type of relationship would be used to relate the policy and claim objects? 1lookup relationship 2 direct relationship 3 self relationship 4 master detail

1 looki In this case, queues are required to manage and allocate claims. A queue requires an owner field, which is not available on child records in a master-detail relationship, so a lookup relationship between policy and claim would be required.

you need to ass. a project manager to a project record. project managers are defined as users in the application. what type of relationship would be most appropriate? 1 lookup 2heriarchical lookup 3 master detail 4 many to many

1 lookup relationship lookup relationshup fields can be defined on the project record that can lookup the standard user object. master detail rel in which the user object is the master cannot be created

dev needs to get all IDs of related accounts on all of the contact records.. what collection data type should the dev use to avoid having duplobate Ids 1 set 2 list 3 map 4 group

1 set set is an nuordered collectoin of elts that do not contain any duplicate. the dev can query all contacts and put it in a list<contact>. then the contact list can be iterated to ge the account id and add it to a set<id>. if 2 or more contacts have the same accountid, only one entry will be in the seet

which of the following are valid definitions for creating or implementing apex interface? 1 flobal class myclass1 extends myclass2 implements myinterfacea{} 2public interface myinterfacea() 3public class myclass1 implements myinterfacea, myinterfaceb{} 4global interface myinterfacea, myinterfaceb{} 5public interface myinterfacea implements myinterfaceb{}

1,,2,3 Similar to Apex classes, an access modifier is used on definitions for top-level interfaces. The name of the interface is defined after the "interface" keyword. An Apex class can implement multiple interfaces by separating the names of the interfaces with a comma after the "implements" keyword. A class that extends from another class can implement an interface. Note that an interface can also extend from another interface using the "extends" keyword. Only one interface can be defined in one definition. An interface cannot implement another interface.

How can the relationship between different accounts be recorded and viewed? 1Using the Parent Account field 2 using the hierarchy link 3 using the generate relationship function 4 using the related acct field

1,2 If the Parent Account has been recorded for each account that has one, Salesforce can generate a family tree for the account using the View Hierarchy link.

A recruitment application is being developed to manage job vacancies and job applications. The business wants to display the number of applications for each job vacancy, and the number should be automatically updated when applications are created or deleted. Also, the parent job vacancy record's security settings should not be inherited by the job application record. Which of the following options are the most suitable for this requirement? 1. create a lookup relationship bt the two objects 2. use flow builder to count the job applications and update the field on the parent record 3. use process builder to invoke a flow that counts the job applications and updates the field on the parent record 4. create a master detail relationship between the two objects.

1,2 a lookup relationship can be created between the job vacancy and job application objects. an after save record triggered flow and before delete record triggered flow can be used to update the count field accordignly on the job vacancy record when job applications are created and deleted. a master detail relationship cannot be used since the detail record would inherit the sharing and security settings of the master record. Process builder is not required to invoke a flow, a flow can be automatically triggered, besides, a process cant be invoked when a record is deleted

which are true regarding how to display data in a visualforce page? 1. data context is provided to controllers by the id paramater of the page 2. expression syntax is used to bind components to the data set available in the page controller 3.the <apex:fieldValue> component can be used to display individual fields from a record 4. object data can be inserted but not global data

1,2 Both object (sObject) and global (profile, users, company, locale, etc) data can be inserted using the expression syntax. The <apex:outputField> component can be used to diplay individual fields from a records

When Apex code is written to catch exceptions, the default notification mechanism is not used when an error is encountered. What are the suitable options that a developer can use to notify the end user, for example, of an exception that was thrown when attempting to save a record? 1 use the addError() method to handle errors that may be causeed by DML stmts in Apex triggers 2 use the apexPages.Message class to create an error message to be displayed on the visualforce page 3 send an email containing exception info in the catch-block of a try-catch construct 4. add an @future method that creates and stores error details in a custom object record.

1,2 the addError method and ApexPages.message class can be used to display user friendly error messages on the UI to end users such as sales or marketing users. the other options are intended for developers or administrators as custom notification mechanisms and tool for troubleshooting and debugging issues.

Cosmic Grande is a hotel in Paris that started using Salesforce recently. When an individual books a stay online, a new booking record is created automatically in Salesforce and the proprietary booking management system used by the hotel. Before each stay that is longer than a week, a customer service associate of the hotel uses a flow in Salesforce to send an email to inquire if the customer has any special request. If the customer sends a reply, it is stored in the booking management system, and the associate has to update the Salesforce record manually. If the customer has a special request, the Salesforce record should be updated automatically. A platform event has been defined in Salesforce. In addition, what should a developer do to meet this requirement? 1.add a pause elt to the flow to recieve a platform event message and update tthe salesforce record 2. use of of the salesforce apis to publish a platform event message from the booking management system. 3. use a proxy server thatt supports making http requests to publish a platform event message 4. add an apex action to the flow to recieve a platform event message and update the sf record

1,2 The platform event definition can be utilized for any replies from customers related to special requests. In this case, the booking management system can act as the event producer and Salesforce can act as the event consumer. The booking management system can use one of the Salesforce APIs, such as REST API, to publish an event message when a customer sends a reply with a special request. Since the requirement is to enhance the current process by automating the step where the associated Salesforce record is updated manually, a Pause element can be added that would subscribe the existing flow to the platform event. Then, the flow can resume the flow interview when a new event message is received and update the related record automatically. On the other hand, a platform event-triggered flow can be created which waits for an event message from the platform event. When it receives an event message, it can perform actions using data provided in the event message. An Apex action in a flow cannot automatically subscribe to a platform event and receive event messages. Using a proxy server is unnecessary to publish event messages for this requirement.

the support agents of cosmic service solutions regularly create and update cases in salesforce. They use Lightning Experience to work on cases. A Lisghtning Web Component has been created for support managers, which provides an overview of all the cases assigned to the support agemts. While they are viewing the component, the support managers would like to be notified immediately when a case is created or updated by a support agent. A platform event has been defined in Salesforce for this requirement. Which solution is correcct for publish/subsicrbe logic. 1. Use an apex trigger to publish event messages and the lightning web component to subscribe 2. use a flow to publish event message and LWC to subscirbe 3. use lwc to publish and apex trigger to subscribe 4. use a new lwc to publish and existing lwc to subscribe

1,2 To meet this requirement, an Apex trigger, process, or after-save record-triggered flow can be used to publish a platform event message automatically when a new case is created or an existing case is updated. The Lightning web component used by the support managers can subscribe to the platform event channel and receive event messages. In the component's JavaScript controller, the empApi methods should be imported from the lightning/empApi module. The imported methods should be called from the JavaScript code. The callback function in the code can display a toast message to the support managers who are viewing the component. The Lightning web component should not be used to publish event messages because the source of the messages should be the creation of new case records and the modification of existing case records by support agents. The Lightning web component can only be accessed by the support managers.

A delivery company uses the Salesforce REST API to publish platform events as one of the notification channels for providing its clients with real-time information about the status of deliveries. A furniture manufacturer, which uses Salesforce to manage their business, has hired the services of the delivery company. The furniture manufacturer needs to automatically update records of sold products that are being delivered to their customers when a platform event message is published. Which of the following should be done to meet the requirement? 1 use $record global var to access field values in event message 2. create platform event triggered flow and specify the platform event 3 use CometD to subscribe to platform event published by delivery company 4 create apex trigger to subscribe to platform event and update records

1,2 a platform event triggerd flow can be created in flow builder, can be subscribed to a specific platform event. the flow can then auto respond to a platform eent message, and use $record global var to access the field valuse, whic can be sued to retrieve necesary recor to update cometD is used to allow external apps to subscribe to platform events published by salesforce. although an apex trigger can also subscribe to platform events and do everything needed, a declarative solution is preferred

which of the following queries show a valid syntax for querying data from related standard objects? 1. SELECT Account.Name, Account.BillingState FROM Contact WHERE Account.BillingState='Arizona' LIMIT 50 2. SELECT Name, (SELECT LastName, FirstName FROM Contacts) FROM Account WHERE BillingState='Arizona' LIMIT 50 3. SELECT Id, (SELECT Name, BillingState FROM Account WHERE Account.BillingState='Arizona') FROM Contact LIMIT 50 4. SELECT Name, Contact.LastName, Contact.FirstName FROM Account WHERE BillingState='Arizona' LIMIT 50 5. SELECT Name, (SELECT LastName, FirstName FROM Contact) FROM Account WHERE BillingState='Arizona' LIMIT 50

1,2 a rel. query is a query on multiple related objects. to create a join in soql, a rel bt the objects is needed. using a rel query, its possible to traverse parent to child and child to parent relationshps. forex, a soql query returning data from the acct object can also retrieve first and last name from contact associated with each acct ret. by the query. Dot notation is used to reference fields from parent objects, while a nested select stmt is used to query child records. dot not. cant be used to query felds an child records, and nested select cant query on parent records. standard child rel. names use plural form of chld object, so from account object, the relationship to contact records is named contacts

Kate, the Director of Operations at Cosmic Solutions, is concerned that critical cases are not being handled properly. She wants to be notified whenever Customer Support management approves a Case to be flagged 'Critical', so that she can monitor its progress. A Salesforce Administrator has been asked to use Custom Notifications to alert Kate about these cases. Which of the following automation features could be used to send Kate Custom Notifications? 1. flow 2. process builder 3. approval process 4. workflow rules

1,2 custom notifications can be created to push notification messages to salesforce users on desktop and mobile. currently, custom not. can be pushed from process builder, flow, and the rest api. workflow rules and ap[roval processes do not curently support sending custom notifications.

what is true about if else statements 1If stmt can be fl=ollowed by discretionary else stmt, which executes if the boolean expression is false 2if else stmt permits a choice to be made bt 2 possbile execution paths 3if else stmt provides a secondary path of execution when an if clause evaluates to true 4if else stmt can have any number of possible execution paths

1,2 the if else stmt permits a choice to be made bt 2 possible execution paths, and not more. the else stmt executes when the if clause is false

Cosmic Solutions has an autolaunched flow "Process_Timecards" which is managed by a Salesforce Administrator that collaborates frequently with a specific business stakeholder. A Salesforce developer is building an Apex controller that needs to run the "Process_Timecards" flow when certain user actions are performed. A variable "params" contains a map of values to pass to the flow. Which of the following commands could the developer use to invoke the flow from Apex? q.

1,2 there are 2 ways to invoke a flow from apex -flow.interview[flowname](params).start(); -flow.interview.createinterview('[flowname]', params).start(); either can be instantiated as type flow.interview.[flowname] or flow.interview, respectively) and later be used to call the start method.paramaters are contained in a map variable. there is no static method start(String, map) in the flow.interview class. when a string is used to dybamically determine the flow that will be run, createinterview must be used. the start method doesnt accept any paramaters

A flow encountered an error in an org and sent an email notification to a Salesforce administrator. The administrator would like to debug the failed flow interview in Flow Builder. However, a link to the flow interview was not included in the sent email. Which of the options below could be possible reasons? 1. the flow interview came from a platform event triggered flow 2. the flow belongs to a managed package and is not a template 3. the error was caused by an action elt in a screen flow 4. the status field of the flow is not set to draft or invalid draft

1,2 when a screen flow, record triggered flow, or scheduled triggerd flow or autolaunched flow with no trigger launches and encounters an error, the failed flow interview is saved in the org. the notif email contains details of the error and includs a link to access the saved flow interview in flow builder for debugging. however, a failed flow interview isnt always saved. forex, the flow interv isnt saved if these are true: error came from a platform event triggered flow, flow isnt active, flow came from managed package & isnt a template, the error eas thrown as result of apex test method, etc. if flow was not saved, email wont have linl. a failed flow interview of screen flow is saved if it is active, forex, rgardless of the elt that thre an exception. if status of metada of flow is draft or invaliddraft, then flow fails arent saved

which of the following statements related to apex best practives about avoiding soql queries inside for loops is true 1. by moving queries outside of for loops, your code will run faster, and is less likely to exceed governer limits 2. when queries are placed inside a for loop, a query is executed on each interation and governer limit is easilty exceeded 3 if a dev needs to query, query once, retrieve all data necesary in a single query, then iterate over the results 4. The following code is an example of improper SOQL limit utilization: for (Account a : [SELECT Id,Name From Account Limit 1000]) { //code_block } 5. Running a SOQL query inside a for loop is advised as long as the LIMIT command is properly used.

1,2,3 Using a SOQL query to define the scope of a loop is only counted as 1 SOQL query against the governor limits. Moreover, it uses proper SOQL utilization methods because it can process query results that return many records and is a good way to avoid the heap limit of the Apex transaction. There is a difference between using a SOQL query inside a for loop and using a SOQL for loop. One of the incorrect options uses the latter to iterate over 1000 Account records. The SOQL query is in the definition of the loop rather than being within the code block, which means that it would only count as a single query against the governor limit. However, the option is incorrect because it basically implies that using a SOQL for loop is improper when it comes to governor limit considerations, which is not true. Also, running a SOQL query inside a for loop is never a best practice in any situation.

which of these can use rollup summary fields 1. Accounts using the values of related opportunities 2. Opportunities using the values of opportunity productts related to the opportunity 3 campaigns using campagn member status or values of campaign member custom fields 4 account using the values of related cases

1,2,3 rollup summary fields are used to display a calculated value of related records. the rollup summary field can be created on any object in the master side of a master detail relationship. forex: Opp-Opp product, Acct-Opp, campaign-campagn member. Since cases are often assigned owners, they cannot be on the detail side of a M-D rel, so they cannot be on the detail side of a rollup sum. (case has a lookup relationship to account)

a developer is considering writing a trigger to perform data validation before saving a record. what other options can be used to enforce and mantain qualty data 1 required field 2validation rules 3 restricted picklists 4escalation rules 5 assignment rules

1,2,3 validation rules,required fields, and restricted picklists cna ensure data quality. other options include lookup fields with filters and setting fields required on a page layout. escalation rules are used for automated escalation of cases upon meeting a certain criteria. assignment rules are used for autom. assignming a case of lead to an owner

which of the following are considered security vulnerabilities in apex and VF development? 1. Cross-site scripting (xss) 2. cross site request forgery(csrf) 3 soql injection 4 soql direct insert

1,2,3 xss attacks cover a broad range of attacks over a where malicious html or client side scripting is provided via web application. the web app includes malicious scripting in response to the user of a web app. SQL/SOQL injection involves taking user-supplied input and using those values in a dynamic SOQL query. If the input is not validated, it can include SOQL commands that effectively modify the SOQL statement and trick the application into performing unintended commands. in csrf, the attackers page contains a url that performs an action on your website. if the user is still logged into your web page when they visit the attackers web page, the url is retrieved and the actions performed

a developer is creating a controller that accepts a String nd a List of sObjects as input paramaters. how will data be passed to the method? 1. the strgin will be passed by value and the list will be passed by reference 2. both params will be passed by value 3. the string will be passed by reference and the list will be passed by value 4. both params will be passed by value

1. primitive types such as strings are passed my value, while non primitive types are passed by reference. this allows the controller to act directly on non primitive types and change the underlying data.

Exceptions show errors and other events that disrupt the normal flow of code execution. Which of the following statements are true about Apex Exception Handling? 1. The catch statement identifies a block of code that handles a particular type of exception. 2. The try statement identifies a block of code in which an exception could occur. 3. The finally statement is required and gets executed after the catch block executes. 4. Comparatively, a throw statement allows you to signal that an error has occurred, while try, catch, and finally can be used to pull through from an exception. 5. You can have multiple Catch blocks to catch all different kinds of exceptions. If you use a generic exception catcher, it must be the first Catch block.

1,2,4 the finally statement is not reqquired but gets executed after the catch block executes. the code in this block will alwys be executed regardless of the type of exception that was thrown and handled. if you need to catch a specific exception/custom exception, it should come first, before the generic exception catcher

an org uses a combination of Person and Business accounts. A dev needs to create a custom controller for the Account object. What considerations should she keep in mind when designing her solution? 1.Use a custom name formula field to ensure both person and business accounts render properly on a page and use this field instead of the standrd field 2. the type of account created (business or person) depends on which name field is used in the insert statement 3. custom controllers can only access person OR business accounts, but not both. To access both types of accounts on one page, you need to also write an extension 4. the name field will return a blank value for Person accounts but not for Business accounts 5. when referencing the namw field using <apex:inputField> you must reference isPersonAccount in your query

1,2,5 As a best practice, create a custom name formula field that will render properly for both person accounts and business accounts, then use that field instead of the standard field in your visualforce pages. if you create a new account and set the name field the record will be a business account. if you create a new account and set the lastname field, itll be a person account. when an input field references the name field, you must use IsPersonAccount in your query so the system knows whether to process the field as a business or person account.

Cosmic Electronics uses Salesforce to manage opportunities. The company also uses an external order management application to manage orders. Sales users use the application to create orders manually after winning sales deals. But the sales director would like to automate this process. When an opportunity is won, the external application should receive a notification and create the associated order record automatically based on the details in the notification. A developer of the company has decided to use a platform event for this use case. Which of the following should be utilized when using a platform event to meet this requirement? 1. apex trigger or process that publicshes an event message 2. platform event definition with custom fields 3. custom object definition with custom fields 4. apex class that subscribes to the plaform event channel 5. CometD client that subscirbes to the platform event channel

1,2,5 In order to meet this requirement, a platform event can be defined and custom fields can be added to it. the custom fields can contain data that should be sent in the event message. salesforce can publish the platform event message and external application can act as the subscriber. An apex trigger or process on the opportunity object can be used to publish a platform event message automatically when the stage of an opportunity changes to closed won. when using an apx trigger, the event message can be published using eventbus.publish( method. the external applicatoin can subscribe to the event channel using a custom CometD client or EMP connector to recieve the message. When a message is recieved, the external application can create an order automatically based on the field values in the message. a custom object definition is not required to set up a platform event. an apex class isnt required to subscribe to the platform event from the xternal system

When would a developer use upsert and external IDs? 1. To load related records without knowing Salesforce record IDs 2. To migrate customizations from a sandbox to production 3. To integrate with an external system 4. To use Web Services API to query for data

1,3

select true regarding developing in the sf multitenant env 1 sf delivers polygot persistence transparacny 2 it isnt possible to index app data as each tennat stores diff types of data in the same app table 3 queries should be selective in terms of number of records returned 4 the custom domain feature ensures that diff customers do not access each others data

1,3 force.com integrates and optimizes several diff data persistence technologies to deliver transparent polygot persistence. only a single api needs to be coded to, no matte which type of persistence is optimal for a given situation, the platform mointor queries and dml operations and throws a runtime exception if they exceed gov limits

a company has a custom object called weekly emplyee summary, which stores a summary of employee data that is tracked in SF, such as hours worked and wage totals. an autolaunched flow has been built to calculate this info and create new weekly employee summary record for each employee every time it is run. cuurently, a SF admin needs to run this manually once a week. They would like it to e run automatically, select best answer/s 1. invoke the flow from an apex job that runs weekly 2. create a workflow rule that launches the flow weekly 3. schedule the autolaunched flow to run weekly 4. use process builder to invoke the flow to run weekly

1,3 the simplist solution is to invoke an autolauncehd flow based on a schedule. schedule triggered flows can be configured to start on a specified date and time, with several frequencey options. the scheduling configuration can be accessed by editing the flows start mode. a more complex solutin would be to invoke the flow from an apex class that implements the schedulable interface, then schedule the class to run weekly. process builder and workflow rules are not necesary to invoke scheduled flows

Which is true about delete and undelete dml operations 1. in a master detail rel. child records are deleted when parent record is deleted 2. assosiation between an opp and a quote cannot be restored after deletion 3. all custom lookup rel. that have not been replaced can be restored. 4. parent and child acct records are supported by the undelete operation. 5. the undelet operation does not restore the record associations for parent cases

1,3,4 salesforce only restores lookup relationships that have not been replaced. for example, if an asset is related to a different product prior to the original prodct reccorrd being undeleted, that asset-product relationship is not restored. undelete can also restore opportunity-quote associations. cascading deletions are supported; if a parent record is deleted, its children are auto-deleted, as in case of master-detail rels. the undelete operatoin restores the record associations for the parent cases

a dev needs to retrieve subquery results from a soql query if the result isnt empty. which lines in the given options can be used to replace the comments in code below to do this. public class QueryHelper { public static List<Opportunity> getOpps(String industry) { List<Account> accts = [SELECT Id, (SELECT Id, Name FROM Opportunities) FROM Account WHERE Industry =: industry]; List<Opportunity> opps = new List<Opportunity>(); for (Account a : accts) { if (/* Check if the subquery result is not empty */) { /* Retrieve the subquery result and add to the opportunity list opps */ } } return opps; } }

1,3 To determine if a SOQL result is empty or not, the method isEmpty() can be used. The method isNotEmpty() is not a valid method in Apex. To add a list to a List collection, the addAll() method is used. The add() method is used for adding a single element to a List collection. The result of a subquery can be retrieved for each record of the returned list by using the child relationship name, which the same name that is used in the subquery FROM clause. For standard objects, that would be the standard plural form of the sObject name (e.g. Contacts, Leads, etc.). For custom objects, the __r suffix, which indicates a custom relationship, is needed (e.g. Appointments__r).

what are valid use cases for using a controller extension in a visualforce page 1.to add a new action in the VF page 2. to replace standard controller 3. to overrid the edit action of standard controller 4. to set any page to always run in system mode

1,3 a controller extension is an apex class that is used to extend the funstionality of a standard or custom controller. it enables a page to override actions such as edt, view, save, delete. it can also add ne actions and isnt used to replace standard or custom controller it extends. though extension typiclly executes in system mode, it will execute in user mode when it is an extension of a standard controller

Cosmic solutions uses salesforce connect to view and update external data innsalesforce. the company would like to define a busness process with the follwoing requirements 1. the business process should be triggered when the status of anorder changes to complete in an external order management system 2. the opportunity record related to the customer should be updated with data from the external system, 3. a record of a custom object ccalled sale sould be created which are valid considerations when using a process that invoked a flow to meet these requirements 1. the process cna respond to events from an external system 2 the flow invoked by the process shouldnt be autolaunched 3 the flow can access both salesforce and external data 4 the process would need to be used to update salesforce data

1,3 an external object can be created in salesforce using salesforce connect. the external object wouldallow accessing data in the external order management system. the flow can look up external object data as well as sf data. it can also be used to update sf data. external ojects are supported by event processes, invocable processes, screen flows, and autolaunched flows for instance, a process can be crreated to recieve a platform event message. the platform can then idntify the related external object defined by the org by matching a field in the event message. however, note that if a platform event triggered flow is used in the scenario, a process wont be requird anymore. this type of flow can directly respond to the platofrm tevent, access external obj data, and create/update sf records

a dev needs to create a triggger that will throw an error whenver a user tries to delete a contact that is not assoc. to an account. what trigger cna the dev use. 1 before delete 2 after undelete 3 after delete 4 before insert

1,3 by using before/after delete trigger, the request can be validated first by determing whether or not the record can be deleted or not. if the record should not be deleted, the trigger can throw an error message and terminate the request. the method adderror will roll back the delete operation if the criteria is meet, making after delete event also viable in this case. before insert trigger is only invoked for insert ops. after undelete trigger event is not applicable in a delete operation.

which of the following statements are true about using a soql for loop to process records in apex? 1. soql for loops can return a list of sobject records or a single sobject records only 2. soql for loops shouldnt perform dml stmts on batches 3 soql for loops can be used to avoid limits on heap size 4 soql for loops can process sobject results in batches of 500

1,3 soql for loops can be used to avoid heap size limit as they process results in batches of 200 sobject records at a time. they can be configured to process records in batches by assigning a List variable to store the query results or one record ata atime by assigning a single sobject vriable. as best practive, soql for loops should perform dml stmts on batch records as opposed to one record ata time in a for loop

which of the following statements are true about apex generic exceptions and built in exceptions 1. noAccessException occurs when there is a problem with unauthorized access such as trying to access an sObject that the current user does not have access to 2. Nullpointer exception occurs when there is a problem with unauthorized access, such as trying to access an sobject when the current user does not have access 3. query exception ocurs when there is a problem with soql queries 4 the generic exception catches all exception types except limitexception 4the limitexception can be caught using a combination of one or more exception types

1,3,4 a nullpointer exceotion occurs when there is a problem with dereferencing a variable. also, the limitexception can never be caught so, the generic exception will be able to catch all exception types except for limit exception. queryexception is designed to catch errors generated from soql processes. a noaccessexception is generated when access to an unauthorized record is attempted through a visualforce page by a current user

what are valid reasons for considering appexhcnage app 1 some appex apps are free 2 appex apps are isolated from other customizations, so they wont interfere with existing functionlity 3 appex apps cover functionlity not covered by salesforce 4 appex apps are open source 5 appex apps can be installed by any SF user

1,3,4 appex apps can interferre with eisting customizations, so they should 1st be tested in sandbox. only SF admins and users with download appex packages permission can install appex app

which of the following ways can be used to throw a custom exception 1 throw new myCustomException(e) 2. throw new myCustomException().addError('Error Message Here'); 3throw new myCustomException() 4. throw new myCustomException().setMessage('Error message here'); 5. throw new myCustomException('Error Message Here');

1,3,5 you can construct exceptions: 1. With no arguments: new MyException(); 2. With a single String argument that specifies the error message:new MyException('This is bad') 3. with a single exception argument that specifies the cause and that displays in any stack trace: new MyException(e); 4. with both a string error message and a chained exception cause that displaya in any stack trace: new MyException('this is bad', e) A throw new customexceptionname().somefunction() stmt is invalid

what are some best practices in aoex class writing 1. use soql query for loop for large datasets to prevent exceeding heap limit 2. query the same object as when required inside a class and store the results in sobject variables 3. avoid hardcoding record type IDs in the code 4. avoid SOQL queries inside FOR loops 5. for the same object, use different triggers for different DML events

1,3,4 The most common best practice while writing an Apex class is to avoid querying data inside a FOR loop as there is a limit on the number of SOQL queries per transaction (100). Record type IDs can be queried initially at the start of an Apex class and stored in variables that can be used anywhere inside the code. Hardcoding the record type ID can cause a problem if there is a change in the record type ID when the code is moved from one org to another. If more than 50,000 records are returned by a SOQL query, the transaction will hit heap size limit. In order to avoid the same, a SOQL query 'for' loop should be used to limit the records that are processed using the FOR loop condition. The results can be stored in a collection variable for manipulating data. Multiple queries on the same object within a single class should be avoided as this can result in exceeding governor limits. The code also looks unorganized and is hard for another developer to follow. Efficient Apex code makes use of collections to store sObject data from a single query, which can be referred instead of using multiple queries. Also, creating a single trigger for multiple DML events is far more efficient than creating multiple triggers on the same object. The order in which the triggers are executed for the same object cannot be determined, which can cause hitting governor limits associated with the number of SOQL queries and DML operations.

which of the following statements are true about controller extensions 1. the extension is assoc. with the page using the \'extensions\' attribute at the <apex:page> component 2. Only one controller extension can be defined for a single page 3. a controller extension is an Aoex class that extends the functionality of a standard or custom controller 4. if an extension works in conjunction with a standard controller, the standard controller methods will also be available. 5. standard or custom controller is an extension of the controller extension

1,3,4 controller extensions extend the functionality of a standard or custom controller, and not the other way around. the methods of the controller they extend will also be available to the extension controller. an extension is added to a page through the extensions attribute of a visualforce page component. multiple controller extensions can be defined on a single page through a comma spearated list.

which of the following statements about defining an apex class is true 1an access modifier is required in he declaration if a top level class 2 a definitoin modifier is requiredin the top level class 3the keyword [class] followed by the name of the class is necesary 4a dev may add optional extensions or implementations 5the keyword [class]is required if no access modifier is present

1,3,4 to define a class, an access modifier (such as public or global) must be used in the declaration of a top level class.one isnt required in the defnition of an inner level class. definition mod, such as virtual or abstract, are optoinal. whether an access mod has been specified or not, the keyword [class] is mandatory

Cosmic Solutions has an Apex Class named 'AccountUtilities', which contains several useful methods for dealing with accounts. One is a non-static method called isAccessible, which accepts an Id of an account record as a parameter, and returns true if the current user has read access to the referenced account record, or false otherwise. Another is a static method called stripInaccessibleRecords, which accepts a list of sObjects, and returns that list after removing the records that the current user cannot view. A developer has defined an Account sObject variable called 'myAccount' in another Apex class. Which of the following can he use to determine if the current user has read access to myAccount? 1.new AccountUtilities().isAccessible(myAccount.Id) 2.new AccountUtilities().stripInaccessibleRecords(new List<sObject>{myAccount}).size() > 0 3.AccountUtilities.stripInaccessibleRecords(new List<Account>{myAccount}).size() == 1 4.AccountUtilities.isAccessible(myAccount.Id) 5.!AccountUtilities.stripInaccessibleRecords(new List<sObject>{myAccount}).isEmpty()

1,3,5 The isAccessible() method is not a static method, so isAccessible must be called on an instance of AccountUtilities, which can be created by running new AccountUtilities(). Static methods are not run on an instance of a class, they are run on the class themselves. The stripInaccessibleRecords method must be run as AccountUtilities.stripInaccessibleRecord(param). Running it on an instance (new AccountUtilities().stripInaccessibleRecords(param)), will result in an error because a "static method cannot be referenced from a non-static context." Since the developer has an Account sObject variable, it must be turned into a list to be used as a parameter for stripInaccessibleRecords, which is done by running new List<sObject> {myAccount} OR new List<Account> {myAccount} (since an Account is an sObject by inheritance). If myAccount is accessible by the current user, the returned list will not be empty (and will have a size of 1).

Cosmic solutions is creating a screen flow with flow builder that will be displayed when users log into salesforce. the flow needs to call an apex method called "notifsecuritymanager()" in the loginHandler calss, which will make an outbound API call to a 3rd party data system. what should a salesforce dev do to allow the flow to call notifsecuritymanager? 1. annotate notifsecuritymanager with @invocableMethod 2. annotate notifsecuritymanager with @AuraEnabled(cacheable=true) 3. ensure notifsecurtymanager() is scoped as public or global 4. annotate loginhandler with @invocableclass 5. make notifsecuritymanager a static method

1,3,5 apex methods that can be called from flows or processes must be annotated with @invocableMethod. Invoc. methods must be static and scoped as public or global classes. @invocableclass is not a real annotation. @auraenabled(cacheable=true) is a valid annotation, but does not impact a methods ability to be called by a flow; it is used with aura and lightning web components

numreical vallues can be initialized in many ways. which of the follwoing are valid numerical apex declarations. 1. decimal num; 2. id num; 3. double avg; 4. blob int; 5. Integer a;

1,3,5 integer is 32 but number wout decimal point. decimal includes decimal point, double is 64 bit number with decimal point. blob is collection of binary data stored in a single object and id is any valid 18 char record identifier

which of the following are true regarding list or set iteration for loops 1. the standard syntax for list or set iteration for loops is:for(Type variable:list_or_set){code_block} 2. the variable may or may not be the same primitiv or sobject type as list_or_set 3. list or set iteration for loops are not useable when one needs to iterate over multiple collectoins in paralell 4list or set iteration for loops can be used when elts in a list or array need to be added or removed while iterating it 5. during execution, the variable is assigned to each elt in list_or_Set and runs the code_block for each value

1,3,5 the variable must be the same type as the collectoin. elements in a list or set cannot be added or removed whithin the code block of a for loop that iterates through it

Sarah has set up the standard Email-to-Case functionality and is testing it. She has found that cases are created from emails sent to the designated email address with the subject populated from the email subject and the case description populated from the email body. The support emails are sent using a standard format that includes the case priority and site location of the customer issue. How can these fields be set automatically when the case is created? 1 Create a custom email handler to map the fields 2 Add field mappings for custom priority and site location in the Email-to-Case settings 3 Create a workflow rule to update the case priority and site location fields 4 Create a before insert trigger on the case object to update the case priority and site location fields

1,4 A custom email handler can be used to parse the email and update the case priority and site location fields. A before insert trigger on the Case object can also be used to parse info from the description field which contain the mail body after cases are created from Email-to-Case Email-to-Case can only map the email subject to the case subject and the email body to the case description. It is not possible to add further field mappings. Workflow rules alone cannot handle the complex parsing required in this scenario.

A dev of a company has defined the follwong apex interface called 'Printable': a junior SF dev has been asked to implement this interface for a new apex class called shirtdesign. which must the junior include in her class file? public interface Printable { Boolean requiresSpecialEquipment(); } 1. class ShirtDesign implements Printable 2. Printable.requiresSpecialEquipment() 3. Boolean variable called requiresSpecialEquipment() 4. A method called requiresSpecialEquipment that returns a boolean

1,4 When implementing an interface in Apex, the class declaration must include "implements [InterfaceName]" after the class name. An interface is similar to a class, but it includes method declarations and not their implementation, i.e., the body of the method). When a class implements an interface, it must provide the body of each method declared in the interface. These implemented methods must have the same signature and return type as defined in the interface (a method signature includes the method's name and parameter types & order). In this case, ShirtDesign must have a requiresSpecialEquipment method that returns a Boolean. The Printable interface defines requiresSpecialEquipment as a method, so it should not be a variable in ShirtDesign. A method cannot be called directly from an interface, as it is only the method declaration and has no implementation. Therefore, Printable.requiresSpecialEquipment is invalid.

when writing an apex trigger, what should a dev keep in mind. 1 an apex trigger should be logic-less and delegate logic responsibilites to a handler class 2. an apex trigger should use @future annotation in performing dml operations 3. an apex trigger should not cause another trigger to be fired 4. a single apex trigger is all you need for each object

1,4 a single apex trigger is all that is needed for one particular object. if multiple triggers are developed for a single object, there is no way of controlling the order of eecution if those triggers can run in the same contexts. another widely recognize best practice is to make triggers logic less. that means the role of the trigger is to delegate responsibilites to another handler calss. an apex trigger may invoke another trigger, and there are methods to prevent unnecessaryt recursion. an apex trigger may or may not use a futuremethod to perform dml statements. note that future methods are asynchronous, and they do not necesarily execute in the same order they are called.

In an effort to securely display data in an organization, a developer is modifying any existing custom controllers that do not use a sharing declaration. Which of the following can be used in the definition of a custom controller class to ensure that only records for which the running user has sharing access are displayed when a Visualforce page invokes the class? 1. with sharing keyword 2. protected access modifer 3. sharing access modifier 4. inherited sharing keyword

1,4 either with sharing or inhertited sharing can be used in the definition of a custom controller class to ensure that it respects the running users org wide defaults. role heirarchy, and sharing rules while displaying a visualforce page that uses that class. using explicit sharing declaration ensures that only records for which the running user has sharing access are displayed. access mods are used to define the scope of the methods and variable that are created within the apex class. they are not used to define sharing declaration.

There are a number of standard objects that don't support dml operations. which of these arenot supported by dml operations 1profile 2 user 3 opportunity line item 4 record type

1,4 it is what it is

which is true about vitual and abstract keywords? 1. methods decalred as virtual have a body and can be overidden by an extending class 2. methods decalred as abstract have a body and can be overidden by an extending class 3. classes declared as virtual can contain both virtual and abstract methods 4. classes declared as abstractcan contain both virtual and abstract methods

1,4 virtual classes cannot have methods that are abstract. only the classes declared abstract can contain abstract methods. however, abstract classes can have both abstract and virtual methods. virtual methods already have a body defined and this can be overridden by extending the class. abstract methods only have a signiture but not body, and it is up to the extending class to provide the body for the method.

what is true regarding this code public with sharing class containerclass{ //code public class innerclass{ //code }} 1. without sharing will be default for inner class 2. the with/out key should only be defined for outer classes 3. the innerclass inherits sharing of outer class 4. the innerclass doesnt inherit sharing of containerclass

1,4 without sharing is default sharing setting for apex classes. inner classes do not inherit sharing settings.

A developer is creating a simple calculator using a visualforce page that will have 2 numerical input fields and perform an arithmetic operation based on the user input. What method should the developer use in order to process and calculate the input of the user in the controller? 1. setter method 2. process method 3. input method 4. pass method

1. setter method-the set method is used to pass values from the visualforce page to the controller. setter methods pass user-specified values from a page markup to a controller. any setter methods in a controller are automatically executed before any action methods. Developer may create a method like this one: public void setNum1(Integer Int1){ num1=Int1}

The support agents of Cosmic Support Services recently started using Salesforce for case management. The CTO of the company would like to implement a call script that walks agents through the process of creating a case in order to streamline their workflow. The script should allow an agent to capture customer information, look for an existing contact, create a contact if it doesn't exist, and finally, create a case based on the details provided by the customer. Which of the following represents the best solution to meet this requirement? 1.use prebuilt flow named create a case and customize it if required 2. create a custom flow that useds elements including screen, get records, and create records. 3/ use a prebuilt flow named create cases and customize it if required 4. create a custom flow that uses elts including screen, loop, and update records

1. a prebuilt flow named create a case can be utilized for this requirement. if necesary, it can be customized based on the requirements and saved as a new flow. it uses elts uncluding screen, get record, create records, decision and assingment. an agent can use this flow to capture a customers name, find an existing contact, create a new contact, obtain case details, and create a case. although a custom flow can be built, its easier to use a prebuilt flow. there is no create cases prebuild. a custom flow that contains the elts screen, loop, and update records wouldnt meet the requirements

select correct query for number of leads for each lead source 1. SELECT LeadSource, COUNT(Name) FROM Lead GROUP BY LeadSource 2. SELECT COUNT(LeadSource) FROM Lead 3. SELECT GROUP(LeadSource) FROM Lead 4. SELECT COUNT(*) FROM Lead GROUP BY LeadSource

1. A GROUP BY clause can be used with COUNT(fieldName) to allow analyzing records and returning summary reporting information.

Cosmic solutions has identified that sales reps being unaware of their upgrade prospects' open support cases causes them to lose sales. In response to this, a Salesforce developer has been tasked with creating a lightning component that will be placed on the opportunity record page. This component will display some key information about the opportunity's account, along with a table of open cases related to that account. The component's server-side controller must efficiently query the data to pass back to the component. Which query will provide the component with the appropriate data? 1. SELECT Name, AnnualRevenue, (SELECT CaseNumber, Status, Subject FROM Cases WHERE IsClosed = FALSE) FROM Account WHERE Id = :accountId 2. SELECT Name, AnnualRevenue, (SELECT CaseNumber, Status, Subject FROM Case WHERE IsClosed = FALSE) FROM Account WHERE Id = :accountId 3. SELECT Name, AnnualRevenue, (SELECT CaseNumber, Status, Subject FROM Cases__r WHERE IsClosed = FALSE) FROM Account WHERE Id = :accountId 4. SELECT Name, AnnualRevenue, (SELECT CaseNumber, Status, Subject FROM Case__r WHERE IsClosed = FALSE) FROM Account WHERE Id = :accountId

1. A subquery (a parent-to-child relationship query) is used to retrieve a list of related child records for each retrieved parent record, and is written inside parenthesis in the SELECT clause. A subquery's FROM clause uses the child relationship name of the lookup relationship on the child. For standard objects, this is generally the plural form of the object ('Cases' in this example). Only custom objects append __r to the end of the child relationship name. The child relationship name can be found on the lookup field setup page in the object manager, and on the org's WSDL file.

The Salesforce Administrator was given a requirement to display the total cost of products at the time they are added to an opportunity. The product cost is a custom field on the product object and is added as a formula field to the opportunity product object. How would the Salesforce Administrator meet this requirement? 1. Create a workflow rule that copies the product cost to a currency field and create a roll-up summary field based on the currency field 2. Create a trigger that queries the product cost values and update the opportunity 3. Create a roll-up summary field on the opportunity based on the product cost formula field 4. Create a trigger that copies the product cost to a currency field

1. Formula fields cannot be used in roll-up summaries if they reference fields on a related object. To meet the requirement, a workflow rule can be configured to copy the value of the product cost formula field to a custom currency field on the opportunity product object. Then, a roll-up summary field can be created on the opportunity object to sum up the values of the custom currency field on each related opportunity product. Programmatic customization is not necessary in this scenario as the requirement can be met with declarative options.

The Salesforce Administrator of Cosmic Financial Services is required to create a new formula field on the 'Contract' object which calculates the expiration date by adding the 'Contract Term (months)' to the 'Customer Signed Date' field. Both of these are standard fields on the object. Which of the following represents the correct formula for the new field? 1. ADDMONTHS(customersigneddate, contractterm) 2. ADD(Customersigneddate, contractterm) 3. DATEVALUE(CUstomersigneddate+contractterm) 4. ADDDATE(Customersigneddate, contractterm)

1. The 'ADDMONTHS' formula function can be used in a formula to return the date that is the indicated number of months before or after a specified date. It uses the syntax ADDMONTHS (date,num), in which 'date' is the specified date and 'num' represents the number of months that need to be added to the date. If the resulting month has fewer days than the start month, then the function returns the last day of the resulting month. Otherwise, the result has the same day component as the specified date. There are no ADD or ADDDATE functions available for formula fields. The DATEVALUE function is used to return a date value for a date/time or text expression, but it cannot be used to add months to a specified date.

Cosmic Smart Solutions uses Salesforce for case management. A record of a custom object called 'Daily Case Log' is created programmatically at the beginning of each weekday. When a case record is created or updated by a support agent, the 'Daily Case Log' record of the current day should be updated with the latest information about the number of closed cases. An email should also be sent to an organization-wide email address that is only used to receive system emails. Which automation tool should be used for this requirement? 1. flow builder 2. process builder 3. worflow rule 4. assignment rule

1. flow builder can be used to create n after-save record triggered flow that is triggered automtcly when a case record is created or updated. it can loop thru all the closed cases, update a field on the daily case log record of the current day accordingly, and execute an action that sends an email to the org-wide email address. process builder cannot be used to create a process that can update a record of an unrelated object, which is why it should not be used here. Its not capable of looping through records also. Similarily, workflow rules can only be used to update the record that triggered it or its parent. an assignment rule is used to assign cases or leads to specific users based on critera.

A Salesforce application is being built for keeping track of company expenses. It has been integrated with an external financial management system used by the company. The developer wants to allow serialization or deserialization only for specific Apex classes that are sent or received as JSON data in the communication between Salesforce and the external system. Which of the following should be done to meet the requirement? 1. Add the JsonAccess annotation to the Apex classes and specify the 'serializable' and 'deserializable' parameters. 2. Configure the serialization and deserialization properties of the Apex classes on the Apex Classes page in Setup. 3. Ensure that the Apex classes implement the JsonData interface and use the 'serializable' and 'deserializable' parameters in the methods. 4. Override the methods that serialize and deserialize the JSON data by adding corresponding methods in the Apex classes.

1. The @JsonAccess annotation can be used for an Apex class to determine in which context it is allowed to be serialized or deserialized. For example, to never allow an Apex class to be serialized but allow everyone to deserialize it, the following annotation can be used: @JsonAccess(serializable='never' deserializable='always'). From version 49.0 onwards, the default access for both serialization and deserialization is 'sameNamespace', meaning serialization and deserialization are allowed as long as the Apex code accessing it is in the same namespace. The Apex Classes pages in Setup does not provide an option to configure serialization or deserialization behavior of Apex classes. JSON.serialize() and JSON.deserialize() methods cannot be overridden. There is no JsonData interface that can be used to meet this requirement.

The Events Manager of a marketing company has asked the Salesforce Administrator to build an event registration form to capture user details and indicate if the registrant was invited by one of their colleagues. If so, a lookup field should appear on the form so that the registration can be associated with the colleague. How can this requirement be best achieved? 1. create a screen flow cwith a lookup screen component and configure its component visibility settings 2. construct the form on a VF pae and use javascript to hide or show the lookup field 3. develop a lighnting component to toggle the vis. state of the lookup field with javascript. 4. build the form on a lightning app and use standard components such as the lookuo field componenet

1. The requirement can be achieved without resorting to programmatic customization by building the registration form on a screen flow. In Flow Builder, a lookup screen component can be added to the form, and then it can be configured to display only when a defined criteria is met such as when a checkbox is ticked. Although a Visualforce page or Lightning component can be developed to meet the requirement, programmatic customization is more costly compared to declarative solutions. It is best practice to always choose a simpler, scalable, and cost-effective option whenever possible. There is no standard lookup field component, nor do individual field type components exist in Lightning App Builder for the Lightning App.

in an apex class, a dev has defined a list of strings named 'emails' to hold several email addresses. how cn they use SOQL to query all Contact records whose emails are included in that list? 1. SELECT Id, Name FROM Contact WHERE Email IN :emails 2.SELECT Id, Name FROM Contact WHERE Email LIKE :emails 3. SELECT Id, Name FROM Contact WHERE Email LIKE emails 4. SELECT Id, Name FROM Contact WHERE Email IN emails

1. To reference a set or list in SOQL query in apex, a bind expression for the set or list can be used along with the IN or NOT IN op. Bind expressions are formed by adding a colon before the variables the LIKE operator is used in partially matching fields against specified text value using wildcards and supports string fields only. however, it cannot be used to operate on a collection variable.

A Salesforce Administrator for a digital marketing company has created a custom object, called Expense, and set its organization-wide default setting to Private. It will be used by employees for tracking and reimbursement of expense claims. A Lightning page was built to facilitate the reimbursement process. The page uses flow for querying Expense records from the different users across the role hierarchy in the org. However, it has been found during testing that the flow is unable to return records properly due to the sharing setting of the object and the role of the user accessing the page. What should be done to enable the application to retrieve all Expense records? 1. se the flow to run in system context without sharing 2. invoke an apex method to perform the record queries 3. enable the grant access using herieachies option 4 configure the lightning page to run as admin

1. a flow can be config to run in system context without shraing which ignores object level permissions and field level secuirty of running user, as well as org wide default sharing settings, role herieachies, sharing rules, manual sharing, teams, and territories although invocable apex method can be used, not neseary as declaritive exist. the \'grant access using heriarchies\' option, enabled by default for all objects, doesnt provide access to records owned by users above the ccurrent user in the role heararchy. a configuration to run a lightning page as a specific user isnt avail

A record-triggered flow uses an invocable Apex method that performs a validation process over multiple related records when the value of the 'Status__c' field on the triggering record is changed. An update needs to be made to invoke different invocable methods, depending on the old and new values of the 'Status__c' field. How should this requirement be handled? 1. Configure the record-triggered flow to access and compare the old and new values of the field and conditionally invoke methods. 2. Replace the record-triggered flow with an Apex trigger that compares the old and new values of the field using the Trigger context variables. 3. Use the Assignment element in Flow Builder to enable the flow to access the old and new values of the field that triggered the flow. 4. Replace Flow Builder with Process Builder since processes can access old and new values of a record using the PRIORVALUE() function.

1. a record triggered flow configured to run when a record is created.updatedd, or updated only, is capable of accessing the precious values of the record that triggered the flow using $record__prior and global variable. by comparing the old and new values using $record__prior and $record__global variables, logic can be implmemnted to execute invocable method accordingly using a decision element. although apex trigger or process builder can be used to meet the goal, they arent needed since existing flow is capable of meeting the requirement. an assignment elt is not required in orddr to acceess old and new values of the record. in this scenario, formula resources can be created and used in a decision elt to branch out to diff actions accordingly.

2 reasons to use controller extension over custom controller

1. When necesary fucnctionality already exists in standard controller 2. Declaritive features that depend on standard controller functionality such as using custom buttons or if the visual force page needs to be embedded in the page layout

a developer has created a visualforce page that contains the code below, what is the security vulnerability in this code? <apex:outputPanel id="output"> The value is <apex:outputText value="{!name}" escape="false" /> </apex:outputPanel> 1. criss site scripting xss 2. cross site request forgery csrf 3. soql injection 4, cross frame scripting

1. the VF page is vulnerable to cross-site scripting (XSS) attacks since it uses the attribute escape=false. by default, nearly all vf page tags escape the xss vulnerable characters. it is possible to disable this behavior by setting escape to false

dev would like to create a new sObject with default values using the describe information of a similair sObject. which of the follwoing can be used to obtain onfo about the type of sObject from an sObject describe result? 1. getSobjectType() 2. getsobjectname() 3getsobject() 4 gettype()

1. the getSobjectType() method returns the schema.sObjecttype object for the sobject which can be used to create a similair sobject when using the newsobject method

how can a developer check if a user has read access to a field and the field can be displayed on a visualforce page 1. call isAccesible() method of schema.describefieldresult to verify field level read permission 2. call isreadablemethod of schema.sobjectresult to ver. field level read permission 3. call the isviewable method of schema.describeffieldresult to verify field level read permission 4. call isaccesible method of schema.describesobjectresult to verify field level read permission

1. the isaccesible method of schema.describefieldresult can be called to check the current users read acces for a field

Dynamic Activities is an adventure company that organizes group trips to climb mountains and explore dungeons. On the custom Reservation object, there is a custom field where the type of activity is registered. This is a custom picklist and contains four values - Mountain A, Mountain B, Dungeon A, and Dungeon B. Based on the activity, a guide needs to be assigned to the reservation and this will be done with a lookup to a Salesforce user. Which will be the most optimal control flow statement to assign the correct guide to each of the reservations? 1. switch statement 2. for loop 3.if-else statement 4. soql for loop

1. the most optimal control flow stmt for this scenario is the switch stmt, use the switch stmt when an expression can be matched against several value represented by WHEN blocks. the for loops can be used to iterate over a set or list, not to match and assign based on expressions and values. the if else stmt can be used to execute blocks based on the outcome of a condition and is less efficient optin in this scenario

a Salesforce dev is writing a method that accepts an Account sObject called MyAccount, which represents an existing account record which has been queried from the database. after changes are made to myaccount in apex, which command would save those changes to the databse? update myAccount save myAccount upsert myAccount modify myAccount

1. the update dml command would be used as it is inteded for saving updates to existing records. the upsert command...the rest is obvious, save and modify dont exist

An Apex trigger needs to be created to handle complex operations when a platform event message containing information regarding an order's status is received from an external order management system. If the platform event's name is Order Event, which option below can be used for defining the Apex trigger? 1. trigger OrderEventTrigger on Order_Event__e (after insert) { ... } 2. trigger OrderEventTrigger on Order_Event__e (after insert, after update) { ... } 3. trigger OrderEventTrigger on Order_Event__c (after insert, after update)) { ... } 4. trigger OrderEventTrigger on Order_Event__c (after insert) { ... }

1. to invoke apex trigger when a platofrm event message is recievved, it must be subscribed to the platform event. to subscribe it, the trigger should be created on the event object type, ending with __e platform events only support after insert triggers. creating a trigger that uses suffix __c would create trigger on a custom object named Order Event if it exists

Which of the following is true regarding view state in a visualforce page? 1. the view state is used to store state across multiple pages, such as in a page wizard 2. the view state is used to store the layout of a visualforce page 3. there is no limit to the size of the view state

1. view state is automatically created and holds the state of the page-the state that includes the components, field values, and controller state. the view state only exists within the current users sessoin and its size limit. the view does state does not contain layout metadata of the visualforce page

Which of the following statements is true about defining getter methods? 1. Every value that is calculated by a controller and displayed in a page must have a corresponding getter method 2. The [get] method is used to pass data from Visualforce page to Apex controller 3. Use the name of the getter method in an expression to display the results of a getter method in a page 4. getter methods are suggested to include logic that increments a variable, write a lof message, or add a new reocrd to the database

1. the '\'set\' method should be used to pass data from a visualforce page to apex conttroller. to pass data from controller to page, use a get messge. the name of the getter method without the prefix get should be used to display results from a getter method also, getter methods should be designed to produce the same outcome, whether they are called once or multiple times dor a single page request. it is best practice for getter methods to be idempotent, that is, without side effects. for example, dont increment a var, write log message, or add record to database. visualforce does not define the order in which getter methods are called or how many times they may be called in the course of processing a request. getter methods return values from a controller. every value that is calculated by a controller and displayed in a page must have a getter method, including booleans

A developer working for Cosmic Cars wrote an Apex trigger that automatically updates the description field of the related opportunities when an account is updated. Cosmic Cars has an account dedicated to managing B2C customers, and the number of opportunities for this account has grown to 200. After deploying the trigger, related opportunities of the other accounts are successfully updated. However, when an update is made to the account which handles B2C customers, Salesforce throws an error. What is causing the error? trigger accountTrigger on Account (before update) { for (Account a : Trigger.new) { List<Opportunity> opps = [SELECT Id, Amount, Name FROM Opportunity WHERE AccountId = :a.Id]; for (Opportunity o : opps) { o.Description = a.Description; update o; } }} 1. governer limits are hit due to the total number of mdl statments issued 2. governer limits are hit due too many records recieved by soql query 3. governer limits are hit due to the max execution time for each apex transaction 4. governer limits are hit due to the total number of soql queries issued

1. the gov limits will be it due to the total number of dml stmts issued since the dml op is exec. in the for loop. the max numberr of dml stmts in a single transaction is 150. good practive is to have dml outside for loops and execute in bulk. soql query will only be executed once. the max exec time iss 10 minutes which shouldnt be reached as there are very few records to process. number of records retrieved in single query max is 50k

a before update trigger has performed validation and determined that the record should not be saved. how can this be done in apex code 1. Use the addError() method 2. raise an unhandled exception 3. raise a custom exception 4. use the break method

1. triggers can be used to prevent DML ops from occuring by calling the addError() method on a record or field. when used on trigger.new records in insert and update triggers, and on trigger.old records in delete triggers, the custom error message is displayed in the app interface and logged

at global conferences, the custom objects conference and speaker are in amny to many relationship via a junction object called conference speaker, a req has been made to the sf admin for a solution after a group of users who only have read access to the conference and speaker objects were unable to create or modify conference speaker records. these users need to be allowed to create and edit conference speaker records. how can sf admin solve this issue best 1edit sharing settings on the master detail rel junction object to read only 2edit sharing settings on master det rel on the junction object to read/write 3edit sharing setting on the master detail rel on junction object to read 4change the org wide sharing settings of the junction object to public read/write

1. when creating or editing the master detail relationships on the junction object, the sharing settings can be set to determine edit, create, and delete access to the junction object reords based on the level of access on the master objects. since the users have read access to the master objects, the read only option should be chosen to allow them to perform crud operations on the junctoin object. read is not a valid sharing setting the org wide sharing settins of an object is on the detialside and cannot be edited directly

a developer has created the following trigger to update description of existing contact records ,how many contract records will be update when a dev loads 2000 opportunity records>? List<Contract> getContracts = new List<Contract>(); for(Opportunity opp: (List<Opportunity>) Trigger.New) { Contract con = [SELECT Id FROM Contract WHERE Id =: opp.ContractId]; con.Description = 'This is the contract for Opportunity' + opp.Name; getContracts.add(con); } update getcontracts; 1. 0 2. 2000 3. 100 4. 1

1. zero in this case, apex has per transaction, limits of 100 synchronous soql queries. the code will encounter an error: System.LimitException: Too many SOQL queries: 101. it is a salesforce best practice to avoidSOQL queries or DML statements inside for loops. only when all the apex code has finished running and the visualforce page has finished running, are the changes committed to the database. if the request does not complete succesfully, all database changes are rolled back, so no records will be updated

Which tag is usede to add css to a visualforce page

<apex:Stylesheet>

Which coarse-grained component can be used to display the detail page of an object in a visualforce page

<apex:detail>

Which component can be used to display indidvidual fields on a record in a visualforce page

<apex:outputfield>

which component can be used to allow users to filter records on a visualforce page

<apex:selectList>

what tag can be utilized in aura component to handle an event?

<aura:handler>

what tag can be used in an aura component to register an event

<aura:registerEvent>

a dev needss to access a list of data on a visualfocrce page and represent data as a table. however, the dev would also like to customize the look and feel and not use the standard salesforce styling. what VF componenets can he use. 1 <apex:listTable> 2. <apex:dataList> 3. <apex:dataTable> 4. <apex:repeat> 5. <apex:table>

2,3,4 <apex;datatable, datalist, and repeat can be used to create tables with custom style

Which of the following correctly describes how the platform features map to the mvc patter 1Model: apex classes;view:pages and components;controller: apex triggers 2. model: standard and custom objects; view:pages and components; controller:standard and custom controllers 3 4

2

A developer is creating a Training application to track training courses and the enrollment of the candidates. Each candidate can enroll in multiple training courses at a time. How can the developer achieve this? 1Create a master-detail relationship between Candidate and Training Course 2Create a junction object to relate many candidates to many training courses through master-detail relationships. 3Create a lookup relationship between Candidate and Training Course 4Create a junction object to relate Candidates to Training Courses and use lookup relationships to relate the junction object to Candidates and Training Courses

2 To establish a many-to-many relationship between the Training Course and Candidate objects, a junction object called Enrollment can be created, which is a custom object that has two master-detail relationships to the parent objects. This enables Candidates to be related to multiple Training Courses at a time.

Project managers would like to be able to record the total amount of hours each team member works on projects. A team member can be related to multiple projects and each project can have multiple team members. How can the developer achieve this? 1 create a master detail relationships on the project object to the tema member object 2create 2 master detail rels from a junction object project team member, one to project object and one to team member object 3create a lookup relationship on both objects to a junction object called project team member 4create a master detail relationship on project and team member objects to a junction obejct called project team member

2 in this case, as a team member can be related to multiple projects and each project can have mul team members, a many to many rel. is required. creating the many to many rel. consists of creating a junction object, ie project team member, and creating 2 master detail rel on project team member, one to project and one to team member. when creating master detail relationships, the relationship field is created on he detail object, in this case, project team member

a service manager wants to send an email reminder to customers who have failed thier enrgy audit to schedule another audit after theyve completed the required modifications. they want this to be done weekly for all the records that still have a failed audit status. how can sf admin easily fufill this requirement 1. create a process using process uilder to select the records with a failed audit status and send them and email reminder 2. create a scheduled flow for the set of records that have failed audit status to send an email 3. create a batch apex for the records that failed the energy auit and schedule apex to send the emaikl 4. create a workflow to select the records with a failed status and associate a workflow actin to send an email

2 using scheduld flow, a set of records can be selected based on specified criteria. a send email action can be added to the flow to send an email reminder to customers who contrine to have failed audit status. this can also be done using apex, but this is more complex than using declaritive option such as flow. processes and workflows only start when records are changed and can only send email alerts

An organization has enabled Multiple Currencies. A developer needs to calculate the total of the Estimated_value__c on CampaignMember object using a roll-up summary field on Campaign object named Total_estimated_value__c. What will be the currency of the Total_estimated_value__c field? 1The field values in Estimated_value__c are converted into the currency of the majority of the CampaignMember records, and the Total_estimated_value__c is shown using that currency. 2The field values in Estimated_value__c from CampaignMember object are converted into the currency of the Campaign, and the Total_estimated_value__c is shown using the currency of the Campaign. 3The field values in Estimated_value__c from CampaignMember object are summed up, and the Total_estimated_value__c field is shown as a Number field on the Campaign. 4. The field values in Estimated_value__c from CampaignMember object are converted into the currency of the current user, and the Total_estimated_value__c is shown using the currency of the current user on the Campaign.

2 If your organization uses multiple currencies, the currency of the master record determines the currency of the roll-up summary field. For example, if the master and detail records are in different currencies, the detail record value is converted into the currency of the master record.

an admin neds to get records with locations saved in geolocation or address fields as individeual longitude and latitude variables. which soql stmt accomplishes this goal 1SELECT Id, Name, Location_long__c, locatoin_lat__c FROM customobj__c 2SELECT Id, Name, Location__latitude__s, Location__longitude__s FROM CustomObject__c 3. SELECT Id, Name, Location__r.latitude, Location__r.longitude FROM CustomObject__c 4. SELECT Id, Name, Location__r.latitude__c, Location__r.longitude__c FROM CustomObject__c

2 Records with locations saved in geolocation or address fields as individual latitude and longitude values can be retrieved by appending '__latitude__s' or '__longitude__s' to the field name, instead of the usual '__c'.

if a dev is required to create a page that will show and add actions on a set of records, what conttroller can accomplish this with the least effort 1 standard controller 2 standard list controller 3 custom controller 4 lightning bundle controller

2 Standard List Controllers allow developers to create Visualforce pages that can display or act on a set of records. Standard List Controllers can be represented just by adding recordSetVar tag on <apex:page>. Alternatively, developers can also use Custom List Controllers - they are similar to Standard List Controllers but require coding in a custom controller or in an extension. A Standard Controller is designed for working on one primary record at a time. There is no such entity as a Lightning bundle controller, although there exists a (server-side and client-side) lightning controller in a lightning component bundle. Neither a Lightning controller nor a custom controller have predefined or built-in functionality for handling a set of records.

Cosmic Solutions sells software and hardware solutions to various corporate clients. There are instances when a contact works as an IT consultant on behalf of multiple organizations. How can this be tracked in Salesforce? 1use the account hierarchy feature 2use the contacts to multiple accounts feature 3create multiple contact records and relate the consultant to each org they consult for 4use the account teams feature

2 The Contacts to Multiple Accounts feature allows a single contact to be related to multiple accounts so that the relationships between people and businesses can be tracked without creating duplicate records. Every contact needs to be associated with a primary account. This is the account that appears in Account Name and is usually the company the contact is most closely associated with. Any other accounts associated with the contact represent indirect relationships.

Given the following value from a Lead record, lastModifiedDate:2016-05-06 03:25:41, what data type should the developer use to retrieve this type of information? 1 TIME 2DATETIME 3DATE 4 DATEVALUE

2 Time is a value that indicates a particular time. While Date is a value that indicates a particular day. The answer is DateTime, as the lastModifiedDate indicates a particular day and time, an example of a timestamp.

Cosmic Innovation has a custom Aura component named 'performanceReviewProcess' in Salesforce that allows HR managers to start and manage the performance review process for the company's employees. It uses an Apex controller named 'PerformanceReviewProcessController'. There is another Aura component named 'performanceReviews' that shows all the ongoing and completed performance reviews. When a new performance review process has been initiated or an existing process has been completed using the 'performanceReviewProcess' component, the 'performanceReviews' component should be updated automatically and any user who is viewing the component should see a notification. Which of the following represents the correct method of using a platform event to meet this requirement? 1. An Apex trigger should be used to publish a platform event message, and the 'performanceReviews' component should subscribe to the platform event channel. 2. The 'PerformanceReviewProcessController' should publish a platform event message, and the 'performanceReviews' component should subscribe to the platform event channel. 3. The 'performanceReviews' component should publish a platform event message, and the 'performanceReviewProcess' component should subscribe to the platform event channel. 4. An Apex trigger should be used to publish a platform event message, and the 'performanceReviewProcess' component should subscribe to the platform event channel.

2 To meet this requirement, a platform event can be defined for events related to the initiation and completion of performance review processes. In this case, Salesforce is the event producer and the event consumer. When a new performance review process is initiated or an existing process is completed, the Apex controller used by the 'performanceReviewProcess' component can publish a platform event message using the EventBus.publish() method. The 'performanceReviews' component can subscribe to the platform event channel, receive event messages, and update the data accordingly. The lightning:empApi component can be added to the Aura component. The client-side controller can call its methods. The 'performanceReviews' component should not be used to publish an event message since it is not used for initiating and completing performance review processes. An Apex trigger should also not be used to publish an event message since the requirement does not include information about any record that is created or updated when a performance review process is initiated or completed. It is better to use the Aura component for publishing event messages since that is the primary function of the component. The 'performanceReviewProcess' component should not subscribe to the event channel since it should be the source of the event messages and not their consumer.

Cool Air Conditioners has been using the Case object in Salesforce to manage issues faced by customers. The company would also like to use Salesforce to manage field service jobs performed for customers by technicians. They would like to track information about the tasks performed for the customers. What is the recommended solution to meet this requirement? 1 INstall an appexchange solution that adds the required functinoality 2utilize the standard objecs work order and work order line item 3create a custom object to manage field service jobs 4create an external field service app and use rest api to integrate

2 Two standard objects in Salesforce, namely, Work Order and Work Order Line Item, can be used to track the field service work performed for customers. A work order can have related work order line items that represent the subdivisions or tasks to be completed. In orgs that don't have the Field Service add-on license, an option to enable Work Orders is available. Installing an AppExchange application or creating a custom object is unnecessary to meet the requirement since standard objects are readily available. Creating an external application and integrating it with Salesforce is also not required.

this code means apex code can be serializedor only if it is in the same namespace and deserialized if it is in the ame package

@JsonAccess(serializable='sameNamespace' deserializable='samePackage')

which annotation should be used for apex method that can be invoked by a process

@invocableMethod

The IT director of Cosmic Solutions would like to prevent Cross-Site Request Forgery (CSRF) attacks on companies wesite. which of these is the specific defense 1. Anti-CSRF secuirty 2. Anti-CSRF token 3. csrf protection 4. security token

2 Within the Lightning platform, Salesforce has implemented an anti-CSRF token to prevent CSRF attacks. Every page includes a random string of characters as a hidden form field. Upon the next page load, the application checks the validity of this string of characters and does not execute the command unless the value matches the expected value. CSRF Protection is the more generic answer, but the more specific answer is that the protection is accomplished via the Anti-CSRF Token. Anti-CSRF Security is another way to talk about security, but again, it is more of a concept than a specific defense mechanism. A Security Token is used by end-users when accessing Salesforce from outside a trusted IP range. It is helpful for use in applications such as DataLoader because it allows users to bypass verification code entry during login. The security token takes the place of the verification code and allows applications such as DataLoader to be scripted without the need for interactive input from the user.

universal insurance uses sf for managing claims. claims is a custom object. if an email is sent from a claimant regarding an existing claim, it should be checked for a unique reference number and if found, attached to the related claim record, and the status of the claim record updated. what feature to sue 1email-to-case 2custom email handler 3email to custom object 4process builder

2 as a custom object is being used, email-to-case cannot be used. email-to-case will create a new case from an email sent to a specific address. email to custom object doesnt exist. while process builder could be used to update a record or parent record it couldnt process an incoming email. a custom email handler can be defined to handle inbound emails and perform operations such as creating or updating records based on the emails content

a company would like to send record info to a legacy system when a criteria is met. a dev can accomplish this by 1 outbound notification rule 2 workflow rule with outbound messages 3 visual workflow 3 assignment rule

2 outbound messageing uses the notifications() call to send SOA{ messages over HTTP(S) to a designated endpoint when triggered by a workflow rule. after you set up outbound messaging, when a triggering event occurs, a message is sent to the specified endpoint URL. the message contains the field specified when you created the outbound message. once the endpoint url recieves the message, it can take the info from the message and process it. Outbound messagin is a distinguishing capability of workflow rules, so any time outbound messaging is required, workflow rule is likely the solution

A developer needs to do a quick one-time load of 100 custom object records into a development environment. The data is in a csv file and each record contains 5 fields. Which tool would you recommend to use to load the data? 1 custom object import wizard 2data import wizard 3data loader 4data api tools

2 the data import wizard wwill allow importing of standard and custom objects The key decision points in this description: 'one-time' means you don't need to save the import mappings for repeated use, as Data Loader and more comprehensive tools can do; 100 records with 5 fields is low volume; each 'custom object' means that Data Import Wizard is capable of importing these records, unlike records for some of the unsupported standard objects.

metadata information about certain custom apps in salesforce org is required in order to render them in the user interface of a mobile app. which of the following can be used by a developer to return the metadata for this requirement. 1. Schema.Decribetabresult[] r = schema.describetabs(); 2. Schema.DecribetabSetresult[] r = schema.describetabs(); 3. Schema.DecribeAppresult[] r = schema.describeApps(); 4 Schema.DecribeSObjectresult[] r = schema.describeSobjects();

2 the describetabs() can be used to return info about the standard and custom apps available to the running user, and result can be stored in a list of achema.describetabsetresult

given the code below, what will be the result? Integer i = 0; String str = ''; for (Integer x = 0; x < 10; x++) { str = 'sampleStr'; i = x; } if (i > 9) { system.debug(str + ' A = ' + i); } else if (i < 9) { system.debug(str + ' B = ' + i); } else { system.debug(str + ' C = ' + i); } 1. str B = 9 2. sampleStr C = 9 3. sampleStr A = 10 4. str B = 10

2 the for loop will iterate the code block until the value of x=9. the value of x, which is 9, will be assigned to the variable i. so varuable int will satisfy the 3rd condition. the expeted output will be answer 2.

which is true about defining fetter methods 1 use the name of the getter method in an expression to display results of a getter method in a page 2 every value thats calculated by a controller and sdisplayed in a page must have a corresponding getter method 3 the [get] method is used to pass data from the visualforce page to the controller 4. getter methods are suggested to include logic that increments variable, write a log message, or add a new record to the database

2 the set method should be used to pass data from a visualforce page to apex controller. to pass data from an apex controller to a visualfroce page, use the get method the name of the getter method without the get prefix should be used to display results from a getter method also, getter methods should be designed to produce the same outcome, whether they are called once or multiple times for a single page request. it is best practice for getter methods to be idempotent, that is, to not have side effects. for exmple, dont increment a variable, write a log message, or add new record to a database. visualforce does not define the order in which getter methods are called, or how many times they might be called in the course of proc.sing a request getter methods return values from a controller. every value that is calculated by a controller and displayd in a page must have a corresponding gette method, including booleans

given the apex class beloq, what is expected result if the code "Vehicle.checkDriver(17) is entered or exeuted public class Vehicle { public virtual class VehicleException extends Exception {} public class AgeException extends VehicleException {} public static void checkDriver(Integer age) { try { if (age < 18) { throw new AgeException('Underage'); } } catch (VehicleException e) { System.debug(e.getMessage()); } } } 1. method cant be called as custom exceptions cannot be extended from eachother 2 code succesfully runs and underage will be printed from debug log 3 unhandled exeption occurs since handler doesnt match error type 4 class cant be compield as custom exceptions cant be defined as virtual classes

2 to create a custom exception class, the name of class must end with exception and extend from the exception class. custom exception classes can be defined as virtual classes so that it can be extended by another custom excption class. since the value of the paramater that was passed into the checkDriver method is below 18, the ageexception error will be thrown. since afeexception extends from vehicle exception, the vehicleexception catch block can handle the error

Cosmic Supermarket uses a custom object called 'Warehouse' to store information in Salesforce about the company's warehouses. A custom Lightning record page has been created to allow users to view and edit warehouse information. Each warehouse record contains information about multiple warehouse managers and their email addresses. Each warehouse manager is assigned to one or more categories of products. Users who can access a warehouse record should be able to send an email to warehouse managers by specifying one or more product categories. In order to meet this requirement, a Salesforce Administrator is creating a screen flow that can be launched using a quick action on the Lightning page. Which of the following should be considered to ensure that the flow gets the required information from the warehouse record to send the email? 1. an elt needs to be added to the flow to get the warehouse record 2. the flow should use a record variable named recordId that is available for input 3. the Lightning page needs to be edited to enable passing the warehouse record to the flow 4. an apex action is required in the flow to access the warehouse record

2 to meet this requirement, a var named recordId should be avail for input. the quick action on the lightning page would automattically pass the record into this record var. the flow can access the var to get the required info for sending an email. it isnt nesesary to add the get records elt to the flow to get the warehouse record. an apex action is also unneeded. the lightning page does not need to be editable to enable passing the record. that would only be required if the flow was embedded o the the lightning page using lightning app builder

A developer imported 4,000 account records into Salesforce and wishes to verify if these were created correctly. There are already over 60,000 accounts already existing in the system. The developer implemented Apex code to check the records created. What is the correct pattern to follow? 1 SOQL stmts should be placed inside loops when matching to ensure updated results for every iteration 2add criteria to soqql select stmts to filter out unnecesary results 3 dml should be used on one instance record at a time 4. use the with shraing keyword to ensure the query willfind appropriate records

2 total number if records retrieved by soql queries in a single transaction is limited to 50k and so queries should be selevtive to not exceed the limit

A developer at Cosmic Solutions is building a utility class with a method that should accept a record of a standard or custom object as a parameter and perform business logic on it. Which data type would be the most appropriate for the method\'s parameter? 1. apex object 2 sobject 3 object 4 custom metadata type

2 when processing standard or custom object, generic sobject type should be used when the object type(such as account, opportunity, or custom object) is not known until runtime. there are several methods avail in the sobject class that allow mutation of sobject records. also, sobjects cna be cast to the specific pbject tyype when needed. the object type represents any data type supp in apex, including primitive data types, instances of cutsom apex classes, and sobjects. it is the super calss that these types iherit from, and is too broad for this question. also, its esier to use the generic sobject type to get the type of the sobject if required apex object can be used as method paramater, but not to represent sobjects. it is typically used as a wrapper that contains variable of other sata types, such as an sobject custom metadata type wouldnt be sueful since requirements specify the method should accept a record of a standard or custom object

which of the ffollowing can be used to update existing standard and custtom fields on child records automatically when a parent record is modifed 1 workflow rule 2process buildeer 3 apex trigger 4 formula field

2,3 process builder can be used to update related records including child records. an apex trigger can also be used to update related child records automatically. a workflow rule can be used to update only the master record that is related to the child record, using a cross-objectfield update action. although a cross object formula field can be used to reference and display values in merge fields from a parent objecct if an object is on the detail side of master detail, it cannot beused to update existing fields on the detail records.

a salesforce admin is considering whether to use lookup of MD relationship. which are capabilities of a lookup rel but not master detail 1rollup summary fields can be added to the parent master object 2related record can have different owner than parent record 3lookup field does not need to be a reqjuired feld on the page layout 4when parent is deleted, child record is always deleted too

2,3 when using master detail rels, the child record inherits the record owner of the parent record. in lookup rels, the child can have a diff owner. lookup rel fields dont need ot be marked as required on the page layout. rollup summary fields can only be added to the parent obj in a maste detail relationship. lookup rels do not support rollup summary fields in a lookup rel, if parent is deleted, child records are only deleted whenthe option to delete this record also is selected, whcih is only avail if a custom object contains the lookup rel.

which are valid 1. long num= 1.2345 2. decimal num= 12345 3. double num= 1234.5 4. integer num=123.45

2,3 Primitive numeric data types form a hierarchy where lower types can be implicitly converted to higher types such as Integer -> Long -> Double -> Decimal. In the example statement above, an Integer can be assigned to a variable of Decimal data type without explicitly converting it to Decimal because Integer is a lower type compared to the Decimal type. Any number with decimal values can be assigned to a Double data type as long as the number is within the minimum and maximum limits of the Double data type. A number with decimal values cannot be implicitly converted to Integer or Long types since Double and Decimal are higher types compared to Integer and Long.

a dev needs to create a constant integer var that should only be avail within the defining class. which is right 1. integer myvar=123 2 private static final integer myvar=123 3private final integer myvar=123 4. final integer myvar=123 5. private myvar=123

2,3,4 The syntax for declaring a class member variable is as follows: [public | private | protected | global] [final] [static] variable_data_type variable_name [value assignment] Modifiers, such as private or static, are optional when declaring a class variable. They are used selectively depending on the given requirement. If a modifier is not specified, it defaults to private. The use or non-use of the static keyword in the declaration is acceptable in this scenario, since there is no specification of how the variable needs to be accessed - whether statically or from an instance. Although the option "Integer myVariable = 1;" is a valid variable declaration, it does not meet the requirement. The final keyword must be used to create a constant variable. Also, when defining a variable, the data type of the variable, such as Integer, must be specified. Note that an assignment value is optional when declaring, but a value should be assigned prior to using the variable.

An invocable method is used to perform a callout that retrieves the latest currency exchange rates from a third-party web service. After a record is created in a screen flow, the invocable method is executed, and the record is then updated with the data returned by the callout. Which of the following are valid statements regarding the Transaction Control settings of this flow? 1. to avoid the uncommited work pending error, the transaction control setting can be set to Always continue in current transaction 2. to avoid the uncommited work pending error, the transaction control setting can be set to 'Always start a new transactoin 3. if the method contains the callout=true attribute, the trnsaction control setting can be set to let the flow decide for succesful callouts 4. if the method is not defined with a callout=true attribute, the callout will still be succesful a long as the setting is 'let the flow decide.'

2,3 When a callout is executed after a DML operation in a single transaction, the 'uncommitted work pending' error is thrown. Screen flows are capable of working efficiently around this limitation by executing the callout in a new transaction. If the 'callout=true' attribute is present in the invocable method annotation, the flow can be made aware that the method contains a callout. The flow can then be safely configured to let it decide at run time, which is the setting recommended by Salesforce. On the other hand, configuring the flow to always start a new transaction would also avoid the error since the method would always be executed in a new transaction regardless of whether it performs a callout. Configuring the flow to always run the callout in the current transaction would throw the callout exception in this scenario. If the 'callout=true' attribute is not added to the invocable method annotation, the flow cannot determine that the method contains a callout. Hence, letting the flow decide for itself would eventually fail in this case.

a developer is required to delete quotes related to an opportunity whenver a quote has been accepted by customerr. a process has been created using process builder for the opportunity object, which uses criterion based a checkbox field that sayhs if a quote has been acceptied. which of these can be used to add the autodelete to the process. 1apex plugin 2apex class with invocable method 3. apex action 4 apex class that implements process.plugin

2,3 apex action can be added to process builder to execute custom logic such as auto delteing quotes related to opp. apx action must utilize apec class with @invacable method annotation. apex class wit process.plugin is available in flows but not process builder

select true regarding future methods 1 methods that are annotated with @future identify methods that are executed synchornously 2. methods that are annotated with @future identify methods that are executed asynchornously 3 methods that are annotated with @futurecan only return void type 4. methods that are annotated with @future can call another @future method.

2,3 future annotation is used to identify methods executed asynch. and only return void type. when you specify future, the method executes when salesforce has available resources

which of the following methods can dev use to determine if it is close to hitting the dml rows gov limit 1. database.countQuery() 2. Limits.getDMLRows() 3. Limits.getLimitDMLRows() 4. System.assert()

2,3 limits.getDMLRows counts the number of records that have been processed with any stmt that counts against dml limits. this can be used together with the getlimitdmlrows() method which returns the actual limit

An admin has added an apex action to a process in the process builder, but is unable to select an apex class/ what is possible? 1. there is no apex class that implements process.plugin interface, required for invoking apex code from a process 2. theres no apex class with @InvocableMethod annotation 3. theres no apex class containing an invocable method that is static and public or global 4. theres no apex class containing a method with @invocable annotation

2,3 the @invocablemethod annotation is used to Identify a method in an apex class that can be run as an invocable action. and invocable method needs to be static and public or global to make it avail to the process thats supposed to invoke it. the process.plugin interface is used for invoking apex method from a flow. the @invocable annotation is invalid

Peter is a Salesforce Developer at Modular Buildings, a construction company in Australia. He is creating a Lightning component that displays information from a custom object called 'Construction'. This custom object stores data about all constructions, including which employees are working on the development, and sensitive information about the deal size. One of the requirements is that the Lightning component should be visible to all users, but the information about the deal size should only be visible to users who are assigned to a profile called 'Management'. The field-level security settings have been updated for this use case. What can Peter do to make sure that the Lightning component shows the sensitive information only to the managers? 1. Use the WITH SHARING keyword in the definition of the Apex class to enforce field-level security. 2. Use the 'stripInaccessible' method to strip the field from the SOQL query that returns the construction records. 3. Use the WITH SECURITY_ENFORCED clause in the SOQL query that returns the construction records. 4. Use the 'isViewable' method to check the field-level read permission for the field before using a SOQL query.

2,3 to make sure that the deal size field is only visible to users with the management profile, the with securtiy enforced clauase can be applied at the end of the soql query that returns the construction records to make sure that field and object level security permissions are obeyed. if an exception occurs due to insufficient permissions, it can be caught and another query can be used to return data. another option is using the stripinaccessible method to strip the sensitive field from the soql query result if the current user should not be able to view the field. the isaccesible method is used to check whether the user has read permission for a particular field. there is no is viewable method. the with sharing keywork enforces sharing rules but not field level security

which of the following action can be performed in the before update trigger 1. delete trigger.new values to avoid changes 2. change its own field values using trigger.new 3. create a validation before accepting own field changes 4. modifying trigger.old values

2,3 trigger.old is always read only and trigger.new cannot be deleted

select true on how sf supports sales process 1 only contacts from the acct record related to the opp can be linked using contact roles 2sf supports selling different items with different processes 3 opp teams can be used to allow a group of people working on a deal to be associated wioth an opp 4. sf features include leads, campaigns, products, price books, opps, and qutoes 5 tema selling can be used to attribute a percentage of success to influential campaigns

2,3,4 contact roles for opportunities track which contacts are related to the opp and the role they play. contacts freom other accts can be linked to the opp using contact roles. it is customizable campaign influence and not team selling that is used to attribute a percentage of success to influential campaigns. team selling is a featuree that allows members of an opp team to work on a deal together and split generated revenue or commisions sf. standard objects which include leads, campaigns, products, price books, opps, and quotes support diff aspects of the sales process as a defaul. diff sales process specific to the org can also be configed for various types of products, product lines, or services. lastly, opp team can be ocnfiged to add multiple users to an opp wherein each member of the team can be assigned roles and special access

select true regarding accessing and sharing prgramatically 1. Account__Share is the sharing object for the account object 2. customObjject__share is the sharing object for a custom object 3. accountshare is the sharing object for the acct obejct 4. object on the detail side of a master detail relationship do not have a sharing object

2,3,4 To access sharing programmatically, use the share object associated with the standard or custom object you are working with. The naming convention for standard objects simply adds Share to the Object name: AccountShare, CaseShare, ContactShare, etc. Custom objects require appending __Share to the custom object name (but without a "c"). For example, the sharing object for MyCustomObject would be called MyCustomObject__Share. Objects on the detail side of a master-detail relationship do not have an associated sharing object, access to the detail records are determined by the master object sharing object and the sharing setting of the relationship.

given folowing visualforce page snippet, which of the following are true <apex:page standardController="Lead" extensions="LeadExtA, LeadExtB, LeadExtC"> <apex:outputText value="{!display}" /> </apex:page> 1. if a method is declared across all extensions, leadextc will overide all methods 2. leadextA, leadextB, or ledextc cannot be used without the lead standard controller 3. leadextA, leadextB, or ledextc are controller extensions used by the visualforce page 4. its possible to have multiple extensions, and extensions can be reused on diff controllers 5. the <apex:outputText> componentwill not render any vlaues since {$}notation is not used

2,3,4 multiple controller extensions can be defined for a single page thjrough a comma separated list. overrides are defined in the leftomst extension, or, the extension thats first in the comma sep. list. in this case, it should be leadexta. extensions cannot be used unless the page has a controller in the first place. extensions can be reusedwith different controllers devs should plan ahead and use inhetritence either from a superclass or an interface so to avoid too many constructors. as with all controller methods, controller extension methods cn be reference with {!} notation in page parkup so apex;ouput text component will display its value

3 reaons for using a static method or variable 1 to persist a variable value beyond the context of a single transaction 2 to store info that is shared across instances of a clas 3 to create a utility method in a class 4to use a method or variable without instantiating its class 4 to access values of instance member variables of its class

2,3,4 since all instances of the same class share a single copy of a static variable, it can be used to store info within the context of a transaction. forexampe, a recursive trigger can use a static variable to determine when to exit the recursion by conditionally setting its value. a static method can be used as a utility method and isnt subject to instance member variables. a static method or varibale is accesed without instanitting the defining class. static variables only persist within the context of a single transaction. static methods cannot access values of instance member variables of its class

The IT director of cosimc service solutions is concerned about cross site scripting (XSS). which of these can be used to neutralize that threat? 1. HTML(JSENCODE()) 2. HTMLENCODE() 3. JSENCODE() 4. HTMLENCODEINJS()

2,3,4 the following functions can be used to neutralize potential xss threats 1. htmlencode()-this function allows performing additional html encoding of input prior to reflection in html context 2. jsencode-this function can be used to perform javascript encoding of input prior to reflection in javascript context 3. jsinhtmlencode-before introduction of auto html encoding, devscalled this function when including merge fields in javascript vent handlers 4. jsencode(htmlencode())this function can be used in place of jsinhtmlencode()

Which of the following is true about using the transient keyword in a ustom controller? 1. Transient variables declared in a visualforce page will increase its view state size 2. transient keywords can be used in apex classes that define types of fields declared in the serializable classes 3. transient keywords can be used for a field in a Visualforce page that is needed only for page request duration 4. transient keywords can be used to declare instance var. that cannot be saved 5. transent variables are transmittted as part of the view state for a visualforce page

2,3,4 the transient keyword can be used to declare instance variables that cannot be saved. a common scenario is on a visualforce page that is utilized only for the duration of the page request. in serializable apex classes, transient can be used ot define the types of fields. declaring varibles as transient reduces view state size. transient variables are not transmitted as part of the view state

which stmts about setter methods are true 1 it is necesary to include a setter method to pass values into a controller 2 setter methods are executed prior to action methods 3 the set method is used to pass values from visualforce page to the controller 4 setter methods must always be conventionally named setVariable where variable is the property name 5 the set method is used to pass values from the controller to a VF page

2,3,4 while a getter method is always required to access values from a vontroller, its not alway necesary to include a setter method to pass values into a controller. if a visualforce component is bound to an sobject that is stored in a controller, the sobjects fields are automatically set if changed by the user, as long as the sobject is saved or updated by a corresponding action method. the getter method is used to pass values from the controoller to the visualforce page, not the setter method

A developer of Cosmic Solutions is using SOSL in an Apex class to search multiple objects and fields for a specific term and return the result. Which of the following are best practices that should be recommended by a data architect when using SOSL for searches in Salesforce? 1. RECORDs that are owned by other users should be targeted for faster searches 2. searches should be performed in specific fields, such as anme fields, instead of all fields 3. search terms should use exact phrases and be as selective as possible 4. records within a division should be excluded in SOSl searches 5. search scope should be limited by targeeting specific objects

2,3,5 In order to ensure faster SOSL searches, exact phrases should be used, and the search terms should be as selective as possible. The search scope can be limited by targeting specific objects, records owned by the searcher, and records within a division, whenever applicable.

dev is creating a flow with a decision point that involves a geolocation field. what should the dev keep in mind when working with geolocations 1. it is possible to specify a latitude without a longitude when saving a geolocatoin field 2. in order to eval a geolocat field, the dev must access each component of the field 3. only ISBLANK, ISCHANGED, ISNULL function can be used in formulas dealing with geolocation 4. geolocation field is essentially a number field 5. equality and comparison operators can not be used with geolocation fields

2,3,5 geolocation is a compound data type cosnisting of 2 components; latitude and longitude. a geolocation field can either be completely blank or it must have both latitude and longitude fields filled in. because geolocation is a compound data type, each of its components must e accessed seperately fro evaluation. the only formula that work is the ones listed in #. you cant use equality or comparison ops

what should a developer consider when using the upsert operation to insert and update records 1. if the key is matched multiple times, the existing record is updated based on the last match 2. to determine whether a record already exists, the upsert stmt or database method used the id of the record as a key to match records, a custom external id field, or standard field with the idLookup attributes set 3. if the key isnt matched, a new object record is created. if the key is matched, once, eisting object updated 4. using upsert, the admin can update, insert, or delete a record 5. using upsert, the admin can insert or update record in one call

2,3,5 if the key is matched multiple times, then an error is generated and the object record is neither inserted not updated, an upsert is capable of inserting or updating a record, but it cannot delete.

what is true regarding saleforce multitenant env 1 all customers share the same code base but have their own database 2 automatic upgrades are applied during the year according to the SF release schedule to all customers 3 metadata includes configuration but not code 4 all customization are specified as metadata, allowing for easy upgrades

2,4 all standard and custom configurations, functionality, and code in an org are metadata. these customization are separated in a special metadata layer, so upgrades can be easily performed. These upgrades are released automatically3 times a year for all customers. In SF's multitenant environment, users share the same code base and database, but gov lims are strictly imposed

a developer needs to update existing accoun records using an import file. how can the reccords be matched so that the ccorrect record is updated 1 match the account name to a column in the imprt file 2 match the record id field to a clomun in the imprt file 3 match the order of the data in imprt file to order of SF records 3 match an external id field defined on the account object to a column in the import file

2,4 an external id field or the salesforce id can be used to match records from an import file to existing records using salesforce data import wizard. There is also the option to match based on the combination of account name and site

Cosmic Motors uses 3 custom objects to track motors, the cars they go in, and the components of the motor. The Developer set up the objects to have the labels Motor, Car, and Component, respectively and accepted the default API name for each object. The plural labels of the objects are Motors, Cars, and Components. Motor has a lookup field to Car, while Component has a Master-Detail relationship to Motor. The developer accepted the default child relationship names when these relationship fields were set up. Which of the following queries show the correct syntax for performing relationship queries between these custom objects? 1. SELECT Name, Car__c.Name FROM Motor__c WHERE Name LIKE '1000x%' 2. SELECT Name, Car__r.Name FROM Motor__c WHERE Name LIKE '1000x%' 3. SELECT Name, (SELECT Name FROM Component__r) FROM Motor__c WHERE Name LIKE '1000x%' 4. SELECT Name, (SELECT Name FROM Components__r) FROM Motor__c WHERE Name LIKE '1000x%'

2,4 For custom objects, the rel name is typically formed by taking ht eolural form of the chuld object, followed by __r. custom objects themselves append __c to api name. to reference data in parent field, __c needs to be appended, but when querying data from related parent object, __c is replaced by __r. for child objects, plural form of API nme is used, and once again __c is replaced by __r. remember to find child relationship name, search cannot be made on parent object, but on child object where looup or md rel is defined.

The Salesforce Administrator is building an application and needs to create a master detail relationship between the standard object Account and a custom object. What is true regarding the relationship? 1 the standard object can be on the master or detial side of the master detail relationship 2the standard object is always the master 3the custom object cna be on the master or detail side 4the object on the detail side will inherit the securityt settings of the master object

2,4 In master detail relationships between standard and custom objects, the standard object is always the master. The detail records will inherit the security and sharing settings of the master.

what is true about how salesforce deals with cross-site scripting (XSS) attacks 1. custom javascript is protected from XSS 2. Salesforce has implemented filters that sceen out harmful characters in most output methods as one of the xss defenses 3. escape should be enabled for visualforce tags e.g. <apex:outputText escape ="true" value="{!$CurrentPage.paramaters.userInput}"/> 4. All standard Visualforce components which start with <apex>, have anti -XSS filters in place

2,4 SF has implmented filters that screen out harmful chars in most output methods. All standard Visualforce components which start with <apex>, have anti -XSS filters in place. By default, nearly all VF tags escape the XSS vulnerable characters. For custom Javascript, the force.com platform is not able to offer protection as it is inteded to allow the dev. to customize the page with script commands

which of the following is the correct syntax for the try-catch-finally block 1. finally { *code here* } catch { *code here* } try { *code here* } 2. try { *code here* } catch (Exception e) { *code here* } finally { *code here* } 3. catch (Exception e) { *code here* } try { *code here* } finally { *code here* } 4. try { *code here* } finally { *code here* } catch (Exception e) { *code here* }

2. In a try-catch-finally statement, the main business logic is executed in the try block. If an error occurs within the try block, it will be caught and handled by the catch block. Then, whether or not an exception was caught, code in the finally block will always be executed as the last phase in the control flow. Finally statements can be used to perform cleanup code such as for freeing up resources.

The Salesforce Administrator of a company has defined a custom object in Salesforce called Insurance_Plan__c that represents the insurance plans offered by the company. What is true regarding the DML operation in the following Apex code written by a developer? List<Contact> myContacts = [ SELECT Id, CreatedDate, FirstName, LastName FROM Contact WHERE FirstName LIKE 'jack%' ORDER BY CreatedDate ASC LIMIT 10 ]; List<Insurance_Plan__c> plans = new List<Insurance_Plan__c>(); for (Contact c : myContacts) { Insurance_Plan__c plan = new Insurance_Plan__c(); plan.Name = 'Standard Plan'; plan.Contact_Id__c = c.Id; // Text field plans.add(plan); } upsert plans Contact_Id__c; 1. The upsert statement updates the record if the Contact_Id__c does not exist, and creates a new record if it exists. 2. A one-to-one relationship between a contact and an insurance plan will be maintained. 3. A one-to-many relationship between a contact and an insurance plan will be maintained. 4. The upsert statement updates the record if the Contact_Id__c exists, and creates a new record if it does not exist.

2,4 The upsert statement uses the Contact_Id__c field on the Insurance Plan object to determine when to create or update the records in the collection. A one-to-one relationship will be maintained because, if an insurance plan with the same Contact Id already exists, an update operation will be performed on the existing record and a new record will not be created.

a junior SF dev has written the following apex class to update all acct records that are assoc. with at least one opp and have the type field set to customer. which should be done in best practice? List oppsLost = [SELECT Id, Name, CloseDate, StageName FROM Opportunity WHERE StageName='Closed - Lost']; for(Account a : [SELECT Id, Name, OpportunityStatus__c FROM Account WHERE Type__c = 'Customer']){ for(Opportunity o: oppsLost){ Id i = [SELECT Id, AccountId FROM Opportunity WHERE Id:=o.Id].AccountId; if(i == a.Id){ a.OpportunityStatus__c = 'Contains at least one lost opportunity'; update a; } } } }

2,4 any redundant soql query should be avoided, esp if its inside a for loop.combining multiple queries of the same object helps create efficient code and avoiding ov limits being hit. thus, accountId should be queried along with other fields in the soql query used to retrieve the oppsLost list. writing comments for any apex code is best bc it helps devs understand the purpouse of a class when need to debug later also, it is best practice to include soql query in the for loop definition to avoid exceeding heap size limits for retrunng large data sets. thers no need to change querying records in the definition of the FOr loop. also, the account record should be updated outdise of any for loop, not just inner.

valid use cases for using a controller extension in a visualforce page 1 to replace the standard controller entirely 2. to add a new action in the visualforce page 3 to set any page to always run in system mode 4 to override the edit action of a standard controller

2,4 controller extension is an paex class that is used to extend the functinoality of a standard or custom controller. it enables a page to override actions, such as edit, view, save, delete. it can also add new actions and is not used as replacement of the standard or custom controller it leverages on. though a controller extension typically executes in system mode, it will execute in user mode when ectending a standard controller

what happens if a gov limit is hit from an apex class that was called from an apex controller class of a visualforce page 1. it will save changes made from the apex controller class 2. it will rollback all changes made up to the error. 3 it will save all changes made from the apex class 4 an exception will be thrown

2,4 one transaction may contain different operations and processes including but not limited to dml calls made by different classes, controllers, triggers, flows, and workflow rules. if, at any point in the transaction a gov limit is exceeded, all changes are rolled back up to the error, and a limit exception is thrown exiting the entire execution proess. so, whichever component or operation in the process that caused to reach gov limit is not significant. no changes will be commited to the database. in a ddition, gov limit exception cannot be handled (try, catch blocks)

an apex class contains a sosl query that searches for the string 'inc' in name field of all accts, opps, and shipment records. which needs to be taken into consideration 1. since sosl query can return a list of sobjects, each object type can be accessed seperately 2. sosl query always returns a list of lists of sobjects but tis possible to access the search result for each sobject type 3. the search results are returned based on the alphabetical order of the objects specified in the returning clause. 4.the search result for each object type can be accessed by creating arrays

2,4 sosl query returns a list of lists of sobjects the orferr of search results is based on the order in which the objects are spec. in the query. an array can be created for each type of sobject in order to access the search result for that specific obejct

how can dev query a multi-select picklist? 1. picklist values can only be specified with AND logic 2. semicolon and comma chars can be used to add filters tfor the multiselect picklist field to the soql query 3. picklist valius can only be specified with or logic 4. picklist vlues canbe specified with and/ or logic

2,4 the semicolog and comma can be used to add filter values to multiselect picklist fields. a semicolon is aspecial char to specify AND. for example, AAA;BBB means AAA and BBB. same thing with comma, AAA,BBB means AAA or BBB

which are abilities of schema builder 1importing schema defintions 2deleting custom object 3creating lookup and master detail rel 4creating a custom object 5 exporting schema definitions

2,4,3 using schema builder, objects and rel can be defined, custom objects can be created and deleted. it cannot be used to import or export schema defintions

select correct ways to declare a collection var 1. new Set()<Account> 2. new Map<Id, Account>() 3. new Array<Account>() 4. new Account[]{<elements>} 5. new List<Account>()

2,4,5 expressions can be a new sobject, apex object, list, set, or map. in the given options, the map of accounts and list of accounts declared sing the list keyword or array notation)square brackets) are valid expressions. a proper declaration sn=yntax for set is mew Set<Account>(). there is no array datatype in apex

what will be the result of the code if there are 2 accounts named ABC? Account myAccount=[Select Id, name from Account Where name= 'ABC']; 1. myAccount will be null 2 an exception will be thrown 3 myAccount will be assigned the first account returned from the query 4my account will be assigned the second account returned form query

2. queryexception will be raied for any problem with SOQL queries, such as assigning a query that returns no records or more than one record to a singleton sObject variable

Cosmic Solutions is creating a Visualforce page to render the current user\'s "First Priority" cases. Management has defined those cases as those that are "High" priority, have a skill rating that matches the user\'s skill rating, and are in "New" status. Skill rating is defined by corresponding custom fields on the Case object and the User object. A developer has decided to use a Standard Set Controller to render the appropriate cases on the Visualforce page. She will create an Apex class "FirstPriorityCaseController" to run server-side logic, including "priorityCases" as the attribute which stores the current list of cases to render. Which of the following can she do to accomplish this? 1. Add standardSetController="FirstPriorityCaseController" as an <apex:page> attribute. 2. Create an ApexPages.StandardSetController with defined query conditions or results. 3. Accept an ApexPages.StandardSetController in FirstPriorityCaseController\'s constructor. 4. Use the getRecords() method to return the priorityCases attribute value. 5. Render an <apex:pageBlockTable> with value set to "{!priorityCases}".

2,4,5 an instance of ApexPaages.StandardSetController is instantiated with either a list(result) tht has already een queried or wwith a Database.getQueryLocater() with those conditions. the apexpages.standardsetcont class has a getrecords() which returns a subset of the preconfigd records depending on other factors like pagination and page size. this subset is the list that should be returned when priotiy cases is accessed, and this logic takes place in a getprioritycases method. an<apex:pageBlockTble> then renders the list of prioritycases on the VF page. not thaat other custom html/css/javascript can be "FirstPriorityCaseController" should be assigned to the attribute controller on <apex:page>, not standardSetController.FirstPriorityCaseController should not accept an ApexPages.StandardSetController in its constructor. A controller extension, however, can accept an ApexPages.StandardController if it is extending the functionality of a standard controller.

which are true about triggers 1. triggers cna be used to detect a before undelete event 2. for the attatchment, contentdocument and note standard objects, a trigger cannot be created in the salesforcce UI. 3. apex triggers are always active and cannot be turned off 4. a dev can specify the version of apex and api which can be used with the trigger 5. trigger code is stored as metadata under the object with which they are associated

2,4,5 apex triggers can be activatd or deacctivated. an active checkbox is available on the trgger object editor that can be sued to turn the trigger on and off. the trigger is stored as metadata underr the object iot descrbies. the dev may check the create>object to see triggers an objects. attatchment, contentdocument, and note triggers can be created in the dev console or using visual studio code. for the version, the dev may navigate to the version settings to specify the version of the apex and api. triggers cannot be used to detect a before undelete event. the supported trigger events are;before insert, before updagte, before delete, after insert, after update, after delete, and after undelete

New Horizon Satellites uses Salesforce for opportunity management for its data service products. There are many variables and complex combinations that can be configured when offering a data service. The company currently uses Excel to produce quotes but would like to use Salesforce instead. What would be the recommended solution? 1Use standard quote template functionality 2look for an appexchange product 3create a visualforce page that displays the quote and allows saving it as a pdf 4create a custom button that allows exporting details to excel 5use salesforce quote to cash functionality

2,5 This requirement would be best met with a Configure / Price / Quote (CPQ) application. There are a number of applications available on the AppExchange which offer this functionality. Salesforce also offers CPQ functionality within the Quote-To-Cash product and may meet the requirement.

A salesforce dev implemented 2 workflow field updates where the option to re-evaluate the workflow rules after the field change is enabled for both. Field update on workflow rule A triggers workflow rule B, and vice versa. What will be the result of this scenario? 1. Only the first triggered workflow will run and the second one will be prevented from running 2. a recursive loop may happenand exceed the org limit for workflow time triggers per hour 3. recursion does not happen as workflow fields updates automatically prevent such occurance 4. the workflow re-evaluation will be automatically prevented from running to avoid recursion

2. workflow rules can create recursive loops. For example, if a field update for rule 1 triggers rule2, and a field update for rule 2 triggers rule 1, it will cause recursion and may cause the org to exceed its limit for workflow time triggers per hour. workflow field updates do not have a recursion prevention mechanism. both workflows will be triggered as one causes the other to run. the workflow re-eval. will be executed

what standard controller action aborts an edit operation and returns the user to the page where the edit originated 1. break 2. cancel 3. stop 4. revoke

2. Cancel: aborts an edit operation. after this operation is finished, the cancel action returns the user to the page where the user originally invoked the edit

The Customer Community users of Bright Starts Company have edit access to the Case object, but have Read-Only access to its Status field. Due to the field-level security setting, a screen flow that runs on the case community page throws an 'insufficient privileges' error when they try to close cases. How can the Salesforce Administrator allow the users to successfully close cases using the same flow without removing the Read-Only setting? 1. call a process crated using process builder from the screen flow to bypass field level security 2. edit the screen flow to run in system context with sharing to ignore certain user permissions 3. conditionally provide access to the status field for users using apex managed sharing 3. upgrade the customer communitu users to cust. commun. plus license

2. Flows can be configured to run in user or system context depending on how the flow is launched, or entirely in system context with sharing mode. Choosing to run the flow in system context with sharing mode causes to bypass certain permissions of the running user such as field-level access. In this setup, the field-level security settings do not need to be changed, and the error thrown by the flow can be avoided if the flow is run in this mode. In addition, a flow can also be configured to run in system context without sharing, which not only ignores object-level and field-level security, but also org-wide default settings, role hierarchies, sharing rules, manual sharing, teams, and territories. A process built using Process Builder cannot be called directly by a flow. Apex managed sharing is used in the context of record-level access and not field-level access. Upgrading the user license from Customer Community to Customer Community Plus has no impact on the field-level security settings of an object.

Cosmic Repair Solutions recently started using Salesforce for case management. The support director of the company would like to implement a business process that is triggered automatically only when the status of a case record changes to 'Working'. It should automatically send an email to the manager of the support user who created the case, create a new record of a custom object called 'Case Log', and update a field on the Contact record related to the case. The administrator of the company has decided to define a flow for this requirement. When choosing the object in the flow, which option should be selected to run the flow for updated records? 1. Any time a record is created or updated and meets the condition requirements 2. Only when a record is updated to meet the condition requirements 3. Every time the record is updated and meets the condition requirements 4. Only when a record is committed and meets the condition requirements

2. When choosing the object in a flow that should be triggered when 'A record is updated' or 'A record is created or updated', the following two options are available: 1) Every time the record is updated and meets the condition requirements 2) Only when a record is updated to meet the condition requirements If the first option is selected, the flow is launched every time the triggering record that meets the given criteria is updated. If the second option is selected, the flow is launched only when the triggering record changes from not meeting the given condition requirements to meeting them. To meet the requirement in this case, the second option should be selected because the actions should be performed only when the status of the triggering case record changes to 'Working' and not every time a 'Working' case record is updated. the other 2 options are invalid

A custom object has a workflow that updates a field after a criteria is met A before update trigger has also been defined on the object. What will happen when a user updates a record so that it meets the criteria of the workflow? A. An exception will be thrown due to a conflict between the two B. The Apex Trigger will be fired twice C. Both will be fired only once D. The Apex Trigger will be fired first, voiding the Workflow Rule due to the order of execution

2. according to the order of execution, before triggers are run, after triggers are run, then workflow field updates are processed. if a field is updated due to a workflow rule, before update and after update triggers arerun again one more time. in ths=is case, since the record meets the criteria of the workflow rule, the before update trigger will be run again after the workflow field update assoc. with the rule has been processedo'

what is true regarding apex variables 1. only static variable are initialized to null 2 all apex variable are initialized to null 3 only class member variable are initialized to null 4. only member variable are initialized to null

2. all apex vars, whether they're class member variable or method variables, are initialized to null. variable need to be intitialized to appropriate values before they are used

a DEVELOPER EXECuted a for loop and needs to stop the action when a certain value is found. what can they use inside the for loop 1. continue 2. break 3 skip 4 end

2. break action should be used to end the entire loop and disregard the succeeding iterations. by contrast, the continue stmt tells apex to stop any further processing for the current loop iteration and to statt on the next iteration. skip is not real, end is no used in apex either

Given the traditional for-loop syntax illustrated in the code snippet below, in what sequential order are the actions in the given steps executed? I. The initialization expression initializes the for-loop block. II. The statements in the code block are executed. III. The exit_condition is evaluated. If true, the loop continues. If false, the loop exits. IV. The increment statement is executed and then the exit_condition is evaluated. for (initialization; exit_condition; increment) { statements } 1. I, II, IV, III 2. I, III, II, IV 3. I, II, III, IV 4. III, I, II, IV

2. first, the initialization stmt will be executed. multiple variable can be decalred andd or intialzied in the stmt. then the exit_condition is evaluated. if the exp evals to true, the loop continues, if false, exit. at the end of the code block, the increment eexpression will be executed. finally, the exit_condition expression will be evaled again, either continueg the loop or exiting

phone factory uses a custom object named iphone inventory which has a geolocation field named storage location. a dev is writing a trigger that needs to update storage location when certain conditions are met. whats the proper syntax to access an modify this field? 1. Phone_inventory__c.Storage_location__c.latitude_s AND/OR phone_Inventory__c.Storage_Location__c.longitude_s 2. Phone_Inventory__c.Storage_Location__latitude__s AND/OR Phone_Inventory__c.Storage_Location__longitude__s 3. Phone_Inventory__c.Storage_Location__c 4. Phone_Inventory__c.Storage_Location__c.latitude AND/OR Phone_Inventory__c.Storage_Location__c.longitude

2. geolocation is a compound data type and cant be directly accessed. to modify a geolocation field data, remove __c from field name and append __latitude__s or longitude to access each component

Cosmic Solutions has a custom Lookup field "Previous Case" on the standard Case object, which references a Case record. There is currently a trigger on the Case object, which performs some minor business logic. A Salesforce developer has been asked to update that trigger with the following requirements: Whenever a case is updated, set the custom field "Most Recent Case Created" on the previous case to the current date. What should the developer consider before accepting this requirement? 1. a case cannot update another case 2. the requiement could exceed max stack depth limits 3. an after update trigger cannot change field values on the record that triggered it 4. a new case trigger should be created for this requirement

2. if a case is updated, and has a chain of related cases based on the previous case field, the max stack depth limit could be reached. this is because each update causes the previous case to fire its update trigger, and so on. salesforce calls this "total stack depth for any apex invocation that recursiely fires triggers due to insert, update, or delete statements." While it is trie that an after update trigger cannot change field values on the record that triggerd it, this consideration is irrelevent to the scenario because the trigger is always updating a related record, not itself. a case trigger can update another case. trigger best practice is to have only one trigger for each object

A real estate company uses a custom checkbox field called 'Is Primary Contact' on the Contact object to allow users to easily mark a contact record as the primary contact of an account. When the primary contact is deleted, the value of a custom checkbox field called 'Has Primary Contact' on the related account should be set to false automatically. While creating an Apex trigger on the Contact object, which trigger event should be used to meet this requirement? 1. before delete 2. after delete 3. before update. 4. after update

2. since the requirement is to update the related account after the primary contact has been deleted, the after delete trigger event on the contact should be used. the before delete trigger event is not recommended as it must be ensured that the contact has been succesfully deleted first before updating the related account. the before update and after update trigger events are fired when a record is updated.

a dev at cosmic solutions is working on deleting several test lead records in a sandbox and emptying them from the recycle bin programatically. given the code snip below, what is the result of the system.debug if the soql query returns the specified number of records? List<Lead> testLeads = [SELECT Id FROM Lead WHERE Name LIKE 'Test%' LIMIT 5]; delete testLeads; Database.emptyRecycleBin(testLeads); System.debug(Limits.getDMLStatements() +' out of '+ Limits.getLimitDMLStatements() + ' DML statements used'); 1. 5 out of 150 dml statements used 2. 2 out of 150 dml statements used 3. 10 of 150 dml statements used 4. 6 of 150 dml statements used

2. the delete dml stmt will only count as 1 towoard gov limit regardless of number of records contained in list. similarilily, the databse.emptyrecyclebin also counts as 1. 1+1=2. the limits.getdml stmts returns number total of dml stmts that have been invoked up to that point, wheras limits.getlimitdmlstmts displats gov lims for dml stmts, whih is 150. the databse.empty recyclebin() can be used to perm delete records from recycle bin and can take list of record ids, sobject, or list of sobjects

what trigger context variable returns true if the current context for the apex code is a trigger, and not a visualforce page, web service, or executeanonymous api call? 1 oldMap 2 isExecuting 3 isUndelete 4 isUpdate

2. the isExecuting context variable returns true if any code inside the trigger context is executing. this means tht a particular trigger can be tested whether it is executing or not with the help of this variable. oldmap is only avail in update and delete triggers that contain a map of IDs to the old versions of the record processed by the trigger. the undelete and isupdatetrigger context vars return true after undelete and update operations respectively

what will be the result of an unhandled exception on any dml stmt 1. a savepoint will be generated 2. dml stmts will be rolled back 3 dml stmts will be saved up to exception point 4 there is no impact on dml stmts

2. when any unhandled exceptions causes execution to halt, any dml stmt that have already occured will be rolled back with no impact on the database

developer is required to override the standard opportunity view button using a visualforce page. What should he do? 1. use a controller extension 2. use the opportunity standardcontroller 3. use a custom controller and replicate the opp detail page 4. use the standardlistcontrolller

2. when overriding buttons with a visualforce page, you must use the standard controller for the object on which the button appears. Forex. if you want to use a page to override the view button on opp. the page markup must include the standardController="Opportunity" attribute on the apex:page tag. a controller extension can also be used when you need to add extra functionality to the visualforce page that you are using as an override

Cosmic Grocery sells various types of household items through its official online store. It uses Salesforce to manage the products. When a product is out of stock, one of the sales agents uses a flow in Salesforce to record certain details and send an email to a partner company with information like the required quantity of the product. A sales user of the partner company checks the email and initiates a new delivery process in an external application. The delivery process should be initiated automatically in the external application after the required information is received from Salesforce. Although the application has automation tools, there is no mechanism to check for incoming emails. When using a platform event to meet this requirement, which publish/subscribe logic should be utilized? 1. An Apex trigger should be used to publish the platform event message, and a flow should be used to subscribe to the message. 2. The flow used by the sales agents should be used to publish the platform event message, and CometD should be used to subscribe to the message. 3. The flow used by the sales agents should be used to publish the platform event message, and an Apex trigger should be used to subscribe to the message. 4. An Apex trigger should be used to publish the platform event message, and another Apex trigger should be used to subscribe to the message.

2. In this scenario, Salesforce is the event producer and the external application is the event consumer. The flow used by the sales agents can be utilized to publish an event message when a product is out of stock. The external application used by the partner company can use CometD to subscribe to the platform event channel and receive event messages. It can initiate a new delivery process automatically based on the content of the event message. An Apex trigger can also be used to publish a platform event message. But a flow should not be used to subscribe to the message since the external application that needs to be the subscriber cannot rely on a flow to receive the message. Similarly, an Apex trigger should also not be used to subscribe to the message.

what is the correct syntax for writing apex trigger 1. trigger ObjectName on TriggerName (trigger_events}{code_block;} 2. trigger TriggerName on ObjectName (trigger_events}{code_block;} 3. trigger ObjectName on TriggerEvents (trigger_events}{code_block;} 4. trigger ObjectName on trigger_events (TriggerName}{code_block;}

2. Trigger_events can be seperated by a comma that includes one of these: before insert, after insert, before update, before delte, after undelete, etc

what will be the result of running the following code if there a re 2 accounts named ABC try { Account myAccount = [SELECT id, name FROM Account WHERE name = 'ABC']; } catch (Exception e) { System.debug('Exception caught'); } System.debug('Continuing'); string myString = 'Salesforce'; System.debug('String size is ' + myString.length()); 1. exception will be thrown and code will stop 2. exception will be caught and code will continue after executing the catch block 3. no exceptions thrown and code executes normally 4. exception caught and code will stop after executing catch block

2. statements after try-catch blocks are executed after an exception is handled

what hapens when this code is executed 1. try { 2. String hello; 3. if (hello.contains('world')) { 4. System.debug('Hello World'); 5. } 6. } 7. catch(DmlException e) { 8. System.debug('DmlException: ' + e.getMessage()); 9. } 10. catch(SObjectException e) { 11. System.debug('SObjectException: ' + e.getMessage()); 12. } 13. catch(ListException e) { 14. System.debug('ListException: ' + e.getMessage()); 15. } 16. catch(Exception e) { 17. System.debug('Exception: ' + e.getMessage()); 18. } 1. no catch blocks(line 7, 10, 13) match the exception criteria such that the error will be unhandled 2. line 3 will cause a NullpointerException and the last catch block (Line 16) will handle the error 3. all catch blocks (Line 7, 10, 13) will be executed even if only one block matches the exception criteria 4. the try block statement will be successfully executed with no errors and Hello World is printed

2. the variable hello is initialized as a string data type with no value assignment such that it defaults to null. Line 3 of the Apex code references/chcks the null value, and this causes a NullPointerException. since neither DMLException, SObjectException, nor ListException is designed tohandle this type of error, the generic Exception handler found on the last block in the series of catch statemnts catches and handles the error

a dev is required to access the opportunity records on a visualforce page without using a custom controlller. How can the developer satisfy this requirement? 1. <apex:page controller="Opportunity" recordListVar="opportunities"> 2. <apex:page standardController="Opportunity" recordSetVar= "opportunities"> 3. <apex:page controller="Opportunity" recordSetVar= "opportunities"> 4. <apex:page standardController="Opportunity" getAllRecordsVar= "opportunities">

2. to use a standard list controller, the standardController and recordSetVar attributes are defined on a visualforce page component. wile the standardController attribute determines the type of the object that is loaded in the page, the recordSetVar attribbute indicates that the standard list controller for the object is used. the recordSetVar attribute also defines the variable name used in the page to access the record collection

a dev wrote a script to generate dummy records in a salesforce org. when deleting the dummy records, it was found that other records were accidently deleted in the process. what dml can be used to recover these records? 1. rollback 2. undelete 3. restore 4. upserrt

2. dml undelete stmt is used to restore records from the recycle bin. upsert is used for inserting or updating records. there is no restore nor rollback dml smtts. a rollback method is available in the database class(database.rollback) to restore a database to a previous state. But, it will require a save point to have been created beforehand.

A developer has declared and initialized a variable named 's' of type String[] to store multiple sObject types. He uses the code below to get describe metadata information for the sObject types. Schema.DescribeSobjectResult[] r = Schema.describeSObjects(s); Which method of the DescribeSObjectResult class can be used to determine whether an sObject appears as 'Account' in the user interface? 1. getName() 2. getLabel() 3. isLabel() 4. isName()

2. getLabel() getlabel method of describesobjectresult class returns the object's label, which may or may not match the objects name

how can a dev get all picklist values of a specific field via apex 1 use the globalPiclist method 2use the fieldpicklist method 3use the getpicklistvalues method 4use the describepicklistmethod

3 the getdescribe method is used to obtain info on the field and then the getpicklistvalues method is used to retrieve the picklist values

What is true about a custom tab? 1. It can only be included in custom applications 2. It can only be included in one application 3. It can be included in as many applications as desired 4. It can only be included in standard applications

3

theres a requirement to validate that the country code of an account field is a valid iso code. there are over 200 codes. what could be used for validation 1 after update trigger 2before update trigger 3validation rule 4workflow rule

3 A validation rule can be used to ensure that the code entered is valid. In this particular scenario, the validation rule's formula field can contain a list of ISO codes with which to verify the country code. There is no need for programmatic customization in this case as a declarative tool can meet the requirement. Workflow rules cannot be used to perform data validation.

what feature can allow users to access social media info about the acct and contacts they are interested in 1 social medi settings in global search 2 social media networks search tool 3 social accounts, contacts, and leads 4 twitter seafch and standard componentss

3 the social acct, contact, and leads feature adds social network info from twitter and youtube to records global search doesnt have a social media settinf, nor is it capable of searching social media content. a soical media network search tool dosnt exist. However, a twitter seafch component becomes available for displaying social media content from twitter once social accounts, contacts, and leads feature is enabled.

Sally is a developer at Sunny Apartments, a construction company building apartments. In order to support a specific business process, Sally created an Apex method which is triggered by a process. There are multiple Process Builder processes, each for a different object, that require the Apex method to be triggered and to return a list of records from that specific object. What can Sally do to create a generic Apex method that can be reused for multiple objects and triggered from a process? 1 create multiple methods and modify them for each object type 2 create an invocable method with multiple object specific return data typed 3 create an invocable method using List<Object> as return data typee 4 create mutliple methods each with a single objec specific reutrn data type

3 A List<sObject> should be used as the return data type to make the method generic. The sObject data type can be used to store records from different standard and custom objects without requiring any change. In addition, invocable methods are required to return a list, or a list of lists, of a primitive data type, an object type, or sObject. Returning a list of a user-defined type or Apex type is also supported. Creating multiple methods will not work as the method needs to be invocable. Although a method can have multiple return statements by using conditional blocks, the return data type is fixed and only one return statement can be executed. Creating multiple invocable methods is possible, but it doesn't apply when a generic method is required.

A developer needs to find all contacts and leads whose 'Title' contains 'VP' and update the 'High_Value__c' field on these records. He has determined that a SOSL query can be used for this use case. Which of the following data return types should be used to store the result of the SOSL query in a variable? 1. List<List<Lead>> 2. List<sObject> 3. List<list<sObject>> List<list<Contact>>

3 A SOSL query returns a list of lists of sObjects, which is why the result of a SOSL query should be stored in a variable of List<List<sObject>>. Each list contains the search result for a particular sObject type.

Global Insurance would like users to be able to enter policy and advisor details on a screen. When a user clicks the 'Next' button on the screen, the advisor commission related to the details entered by the user should be displayed on the next screen. What would be the recommended solution for this requirement? 1create a process with process builder 2create a visualforce wizard 3create a flow ith flow builder 4create an approval workflow

3 A flow can be used to create a wizard-like interface where details can be entered on one screen and a calculation displayed on the next screen. Visualforce is not necessary as the requirement can be met by a declarative solution. Neither approval workflows nor Process Builder can be used for building interfaces.

EV cars has a webform on their website where the visitor can ask questions or log an issue. after submitting the fform, a case will be created in Salesforce via the REST API. the service manager of EV Cars wants to check if an existing constact is already in the system and if there are any other records related to the email address from th webform. what approach should dev take to do this. 1. use separate soql quesries for each object 2. use web-t-case 3 use a sosl query to find matching records 4 use multiple sosl queries to find matching records for each object

3 A sosl query can be used to look for multiple records in multiple objects with just one sosl query. Web to cas doesnt allow you to automatically search for related records, and using separate soql queries is less efficient

There is a requirement to validate that the country code of an account field is a valid ISO code. There are over 200 codes. What could be used for this validation? 1after update trigger 2before update trigger 3 validation rule 4 workflow rule

3 A validation rule can be used to ensure that the code entered is valid. In this particular scenario, the validation rule's formula field can contain a list of ISO codes with which to verify the country code. There is no need for programmatic customization in this case as a declarative tool can meet the requirement. Workflow rules cannot be used to perform data validation.

A developer would like to relate an external data object (Social Media Posts) to the contacts object in Salesforce to track every post the contact has made in the external platform. How can the developer achieve this? 1 create a master detail relationship and update the reocrd id through integration 2create an external lookip relationship using custom field with external id and unique attributes 3 create an indierct lookup using a custom field with external and unique attributes 4 create a lookup relationship and update the reord id through integration

3 An indirect lookup relationship links a child external object to a parent standard or custom object. When you create an indirect lookup relationship field on an external object, you specify the parent object field and the child object field to match and associate records in the relationship. Specifically, you select a custom unique, external ID field on the parent object to match against the child's indirect lookup relationship field, whose values come from an external data source.

A developer created a lookup field on a custom object "feedback". the lookup references the standard acct object. which statement is correct 1 if an acct record is deleted, related feedback records will be deleted 2any user that can view acct records can also view its related feedback records 3if an acct is deleted, related feedback records will not be deleted 4 the owner of the acct record will be the owner of the related feedback ecords

3 Deleting either a parent (account) or child (feedback) in a lookup relationship does not cause the other to be automatically deleted. A lookup can be configured to prevent deletion of a parent record (account) if it has children (feedback). Additionally, ownership is unrelated from lookup relationships (parent and child records can have different owners and sharing models). Master-detail relationships are different. When a master record is deleted, all of its detail records are also deleted. Record-level sharing of detail records is the same as its master (if a user can view a master record, he/she can also view its detail records).

the code snippet below throws an error during buulk data load. what is the root cause> for (Contact con : Trigger.new) { if (con.PostalCode__c != null) { List<State__c> states = [SELECT StateId__c, PostalCode__c From State__c WHERE PostalCode__c = :con.PostalCode__c]; if (states.size() > 0) { con.StateId__c = states[0].StateId__c; } } } 1. condition is invalid and will always be null 2. variable 'con; is not declared 3. SOQL query is located inside the for loop code 4. no update DML over list of contact

3 There is a governor limit that enforces a maximum number of SOQL queries allowed in a single transaction. To help avoid hitting the limit, queries inside for loops should be avoided. If a query is needed, query once, retrieve all the necessary data in a single query, and then iterate over the results. A SOQL for loop can also be used to automatically retrieve and return results in batches of 200 records. The variable 'con' is declared in the for-loop definition. The null check on the PostalCode field is a valid condition. Absence of a DML operation does not throw an error. However, note that for before triggers, a DML statement on the object that invoked the trigger will throw an SObjectException. Also, a DML statement inside the for loop would potentially cause a DML limit exception.

what is order of execution when a recordis saved 1System Validation Rules, Before Triggers, All Validation Rules, Workflow Rules, After Triggers, Assignment Rules, Commit 2System Validation Rules, User Defined Validation Rules, Before Triggers, Workflow Rules, After Triggers, Workflow Rules, Assignment Rules, Commit 3System Validation Rules, Before Triggers, All Validation Rules, Duplicate Rules, After Triggers, Assignment Rules, Workflow Rules, Commit 4System Validation Rules, Workflow Rules, All Validation Rules, Before Triggers, After Triggers, Assignment Rules, Commit

3 When a record is saved, Salesforce performs a number of events in a certain order. System Validation Rules, Before Triggers, System and User Defined Validation Rules, Duplicate Rules, After Triggers, Assignment Rules and Workflow Rules are performed. There are additional events in addition to the ones listed.

which of the following types can a rollup summary field calculate 1 text 2 checkbox 3 number 4 picklist

3 if SUM is selected as rollup type, numer, currecny, and percent fields can be calculated if min or max is selsected, type, number, currency, percent, date, and date/tune are available`

Given the interface and class below, what is the expected result if the class is instantiated? /** interface **/ public interface document { String getTitle(String prefix); } /** class **/ public class diploma implements document { public String title = 'New Document'; public String getTitle(String newPrefix) { return newPrefix + ' ' + title; } public void setDate() { /* do something */ } public diploma() { if (String.isBlank(title)) { System.debug('No Title'); } else { System.debug(title); } } } 1. the code wont even compile bc of the extra method setDate which isnt defined in the interface 2. code wont even compile because the paramater name of getTitle method doesnt match with interface 3. new document will be printed in log 4. no title will be printed in log

3 new document will be printed in the log but not no title since the value of the title variable is already defined through the property definition. the implementing of the class can also define other methods in addition to the implemented ones required by the interface. if method signiture has an argument, the implementing method must aslo have the same argument data and type, but doesnt need to have the same var/arg/param name.

a salesforce admin is working on a flow screen for capturing student registrations at a university. one requirement is that certain fields in the form should be displayed only when those field are relevant/needed. what can be used 1page layouts can be assigned the form based on state of screen components 2 lightning record pages can be config to control visibility of screen componenets 3component visibility criteria can be defined using screen components 4 standard screen components should be used on the flow screen

3 screen componenets can use conditional visiblity filters which can be configured to make screen components visible if criteria are met. for ex, a screen component can be made vis on form only if checkbox is ticked conditional vis filters are for standard/custom/appexchange screen componenets. lightning record pages can be sued to control vis fo lightniong componenets, but not flow screen components. page layouts can only be assigned to reccords types.

select true about defining apex classes 1. it is optional to specify an access mod in top level class 2. top level class can have multiple levels of inner classes 3. it is required to specify an acced modifier in top level class 4. it is optional to specify an access mod in inner class

3,4 it is mandatory to specify one of the access mods when declaring a top level class, whule it isnt mandatory to spec. access mod for inner class. you must use one of the access mods(publi, global...) in the decl. of top level class. the private access mod declares the class is only known locally. the default access for inner classes is private. if the access mod is not specified for an inner class, it is considered private. inner classes can only be one level deep

which of the following types of methods in a csutom controlller support the use of dml stmts such as insert and update? 1. get method 2. constructors 3. set emthods 4.. static methods

3,4 DML cant be used in get or constructor methods, but can in the other 2`

Universal contain. has triggers that fires on updates for accts, contacts, and opps. each of these triggers contain dml actions thatexecute before or after a record update. each of the objects has active approbval process. select valid considerations when modifying trigs. 1. Every trigger will have its own set of dml limits within a transaction 2. dml stmts should be run inside for loops so apex compiler can bundle them together 3 every dml stmt executed in any of the 3 trigs will count towoard the overall limit within a transaction 4 calls to approval.process() will count towoard the dml limit

3,4 dml limits apply across the full span of a transaction, so all 3 share the pool of limits avail. dml stmts should never be put inside loops bc they will execute once for each iteration. insteat, should be put in a list and executed once. in addition to traditional dml smtts like insert, update, upsert, delete, undelete, and merge, ceratain method calls such as Approval.process(), Database.convertlead, EventBus.publish, System.runAs, etc also count towoard the dmllimit

dev created a trigger with the following code, what is true trigger LineItemPerInvoice on Invoice_Statement__c (before update) { for (Invoice_Statement__c invoice : trigger.new) { List<LineItem__c> lineItems = [ SELECT Id, Units_Sold__c FROM LineItem__c WHERE Invoice_Statement__c = :invoice.Id ]; for (LineItem__c li : lineItems) { // do logic here } } } 1. The trigger bypasses the problem of having the SOQL query called for each invoice statement. 2. The trigger has only one SOQL query performed and is still within the governor limits. 3. The SOQL query performed inside the loop retrieves the line items for each invoice statement. 4. When updating more than 100 invoice statement records, it will throw a runtime exception for exceeding the governor limit for SOQL queries. 5. The trigger shows an example of inefficient querying of line items.

3,4,5 A common mistake is that queries are placed inside a for loop. There is a governor limit that enforces a maximum number of SOQL queries. The SOQL query will be performed once for every item in Trigger.new. If the number of records passed in is below the SOQL governor limit, the trigger might operate properly. However, since there is no way to know how many records are getting inserted or updated at a time, it is possible that the trigger would fail if the number of records processed exceeds the allowable number of SOQL queries. Currently, Salesforce imposes a limit of 100 SOQL queries in a transaction, so if the trigger receives over 100 records, it will fail on the 101st iteration through the loop. It is also possible that this is not the first trigger that fired in the transaction, which could mean that some SOQL queries have already been used up in earlier triggers during the order of execution.

A developer at Cosmic Solutions is working on an Apex class to help with updating the rating of leads based on the rating of a specific lead named John Doe. However, the class is returning an error and not compiling. What is the reason for this error? public class LeadHelperClass { public static void updateRating(List<Lead> leads){ Lead myLead = [SELECT Id, Rating FROM Lead WHERE Name = 'John Doe' LIMIT 1]; String rating = myLead.Rating; for (Lead myLead : leads) { myLead.Rating = rating; } update leads; } } 1. the variable'rating' should be Integer 2. there are more thaan one lead with John Dell name in org 3. the var 'myLead' cant be redefined for the loop 4 the field 'Name' s missing from the selected fields in the SOQL query

3. In Apex code, if a variable name has already been defined in the parent block, it is not possible for sub-blocks to redefine that variable name. The lead variable 'myLead' has already been defined in the parent block before the for loop, so in order for the code to compile, a different name must be used for the loop variable and any expressions related to that variable within the loop. Rating is a string picklist on the Lead object. The SOQL query has a LIMIT of 1 and will only use the first record returned if multiple lead records are matched. A field doesn't need to be included in the SELECT statement in order to be used as a criterion in a SOQL query's WHERE clause.

A Salesforce Developer has created a method inside a custom controller with the following code to return an error message on the Visualforce page that uses the controller. However, during testing, it was found that the Visualforce page does not return the error. What could be the possible reason? # Apex Controller: ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR, 'Unable to Sort Last Name'); ApexPages.addMessage(myMsg); # Visualforce Page: <apex:page controller="ContactsListController"> <apex:form> <apex:pageBlock title="Contacts List" id="contacts_list"> <!-- Contacts List --> <apex:pageBlockTable value="{!contacts}" var="ct"> <apex:column value="{!ct.LastName}"> <apex:facet name="header"> <apex:commandLink action="{!sortByLastName}" reRender="contacts_list"> Last Name </apex:commandLink> </apex:facet> </apex:column> </apex:pageBlockTable> </apex:pageBlock> </apex:form> </apex:page> 1. the whole page is refereshing and at that point loses the message 2 the correct syntax for apex pages on the controller side 3 the message compomnent <apex:pageMessages> is not added to the page 4. the entity that causes the error is on the rerender attribute which will cause the error not to show

3. The <apex:pageMessages> component is used to display all messages that are generated for all components on the current page including error messages. The Apex method for generating a message is ApexPages.addMessage(ApexPages.Message message). The page will only clear the added message on the next page load. The reRender attribute is used for specifying the id of the page component to update when implementing partial page updates.

A company is performing a code review for a custom Salesforce application they have built to identify any security vulnerabilities before releasing it in production. Given the following code, what should be advised? String dep = ApexPages.currentPage().getParameters().get('department'); if (dep != null) { String query = 'SELECT Id, Name from ' + dep + ' limit 10'; // some code here } 1. Add more fields and expand limits [limit 10] on string query to refine search. 2. It is not advisable to use string queries. Refrain from using those. 3. Define exact condition in [if(dep != null)] and avoid using null. 4. Use a variable instead of getting a parametric value on the URL.

3. Using the defined Departments, define exact condition in [if(dep != null)] and avoid using null. A good solution is an "allowlist", or list of known good values that the user input should conform to. To prevent SOQL injection, add in allowlisting by verifying that the value of the [department] URL parameter conforms to one of the expected values, e.g. FINANCE, ENGINEERING, SECURITY, HEALTH.

given that SF is a multi-tenant platform, what is the appropriate pattern to follow for writing apex code 1 to minimize deployment errors, apex code is developed in a diff env 2 to prevent acess from other server tenants, the with sharing keyword is used in apex classes 3 to prevent exceeding gov limits, filter records in soql stmts 4.to avoid data concurrency issues, dml ops should only be used for one record at a time

3. When writing code in a multi-tenant environment, developers need to use patterns that prevent governor limits from being exceeded. An example of a limit is the total number of records that can be retrieved in a single transaction. DML statements should be operated on a group of records to reduce the DML count towards the governor limit. One cannot write Apex on a production org, and programmatic configuration is always done on a different org such as a related sandbox or developer org. Tenants are never able to access each other's records.

A junior Salesforce Developer at Global Containers is working on an after update trigger on the Opportunity object. Given the code snippet below, what would be the result when a mass update is made to 200 Opportunity records with amounts over $1,000,000, provided that there is a user in the org with the role 'Sales Manager'? trigger OpportunityTrigger on Opportunity (after update) { User u = [SELECT Id FROM User WHERE UserRole.Name = 'Sales Manager' LIMIT 1]; for (Opportunity o : Trigger.new) { if (o.Amount >= 1000000) { o.OwnerId = u.Id; update o; } } } 1. nothing since the code will not compile 2dmlexception 3 finalexception 4 limitexception

3. a finalexception will be thrown when the code reaches the ownerid assignment line since trigger.new records can only be edited in before triggers. the compiler wont detect this and code will still be compiled. since the code never reaches the update dml operation, no limitexception or dmlexception will occur.

which of the following corresponds to the proper declaration of a constant variable 1. public static string privconts='private'; private string privcons='private'; static final integer privcons=200; global static integer privcons=250;

3. correct wya uses the final keyword to initilalize privcons to 200. static vars are assoc with the class and not the instance and can be accessed wout instantiating the class

A Salesforce Developer at Cosmic Solutions is working on an Apex class that utilizes the Crypto class to encrypt vital data. Given the code snippet below, how can they decrypt the encrypted data and validate it against the original string value? public class CryptoHelperClass { public static Blob encryptData(String data) { // Initialization vector must be 16 bytes Blob initializationVector = Blob.valueOf('Example of IV123'); Blob key = Crypto.generateAesKey(256); Blob dataBlob = Blob.valueOf(data); Blob encryptedData = Crypto.encrypt('AES256', key, initializationVector, dataBlob); // Decrypt method // Debug decrypted data to compare with original string return encryptedData; } } 1. Blob decryptedData = Crypto.decrypt('AES256', key, encryptedData); 2. String decryptedData = Crypto.decrypt('AES256', key, initializationVector, encryptedData); 3. Blob decryptedData = Crypto.decrypt('AES256', key, initializationVector, encryptedData); 4. String decryptedData = Crypto.decrypt('AES256', key, encryptedData);

3. in order to descrypt an aes encrypted blob, the crypto.decrypt() method can be sued. this method returns a blob value, so the toString() method is also needed to print the decrypted string for comparison the crypto.decrypt method takes 4 params. the alg name, the private aes key, the initialization vector used, and the data encrypted with the crypto.encrypt method. the alg name, private key, and initialization vector msut match the ones used in the crypto.encrypt method. Also, its best practice to securely store the generated private key in a protected custom setting or custom metadata type in order to use it for decryption in other classes/applications. private key size must match the aes alg used(e.g 256 bit for aes256)

A developer has created two custom objects with API names 'Sales Order__c' and 'Shipment__c' to track orders and shipments related to them. Sales Order is the parent in the master-detail relationship between the two objects. The Shipment object has a custom field named 'Tracking_Number__c' that indicates the tracking number associated with a particular shipment. The developer is writing an Apex class in which he needs to retrieve all the sales orders and the tracking numbers associated with their shipment records using a SOQL query. Which of the following represents the correct syntax of the query? 1. SELECT Name, (SELECT Tracking_Number__c FROM Sales_Order__c.Shipment__c) FROM Sales_Order__c 2. SELECT Sales_Order__c.Name, Shipment__c.Tracking_Number__c FROM Sales_Order__c, Shipment__c 3. SELECT Name, (SELECT Tracking_Number__c FROM Shipments__r) FROM Sales_Order__c 4. SELECT Name, (SELECT Tracking_Number__c FROM Shipment__c) FROM Sales_Order__c

3. parent child relationships can be traversed in the select clause of a soql query by using a nested query. in this case, shipments__r is the name of the relationship tha the parent object named sales_order__c has with the child object names shipment__c

sales reps in a furniture distribution center use a screen flow that guides them through a standardizde follow up process after quotes have been reuested and recieved by cusomers. after a certain stage is reached in the flow, it should create a job order record and then perform an http callout, which contains the details of the job order, to a partner manufacturing company. whic of the following should be done to meet the requirement? 1. use a screen elt in the flow after the record is created and before the invocable method is called in the flow 2. ensure that the create records elemtn is immediately followed by the action elt for the callout 3. add the callout attribute to the invocable method annotation and configure the action in the flow accordingly 4. use a process instead of a flow action elt to call the invocable method after the record is created

3. performing a callout after a dml operation is not allowed and will throw an uncommited work pending error. however, screen flows are capable of working around this my running the callout in adifferent transaction. the callout attribute should be added to the invocable apex method to make the flow aware that the apex method performs a callout. then, the transaction control setting of the action elt can be configed to let the flow decide how to run the method at runtime. a screen elt can be inserted after the record creation to avoidthe callout exception bc the succeeding path after the screen is executd in a new transaction. however, this isnt necesary bc of the transaction control feature. if a process was used to fire the invocable method, the callout stillwould be thrown since it would still be in the same transaction that was initiatedby the flow

Suzan is a Salesforce Developer at Cosmic Beauty. Suzan is creating a custom Lightning Component in which products will be loaded and would include information about the maximum allowed discounts that can be provided for each of the products. The field 'Maximum Allowed Discount' is only visible to the Sales Managers and not to the Sales Representatives. When the Sales Representatives want to provide a discount they have to consult their manager to establish a discount percentage. What method can Suzan use to strip fields the running user cannot access and only use one SOQL query? 1. make the soql query variable based on the proficle of the running user 2. use the with sharing method in apex 3. use the StripInaccesible method in Apex 4. use the 2 different page layouts, remove the maximum allowed discount field from the sales representitve page layout

3. the stripinaccessible method in apex will return the same list of results for every user but strips inaccesible fields for the running user. the with sharing keyword can be used at the class level but will not strip fields when runnin user doesnt have access to one of the fields. making the query variable is possible, however, this isnt preffered as it does not enforce any security methods. using 2 diff page layouts is not an option here

when an opp is closed, commision records need to be created automatically for ewach member of the opp team. the commision custom object has a numeric field wherein its value is calculated based on the role of the member, time to close the deal, and type and value of the opp, how can this be achieved 1 workflow 2trigger 3flow 4process

3: flow builder an auto launched flow can be configured to automatically start when the opp is closed to create the commision records, as well as perform the logic required to compute commision values workflow rule cannot create records. although proces builder can, it cant create multiple records dynamically. trigger is not needed as requirement can be done declaritively

which of the following apex control statements allows a developer to iterate on each elt of a collectoin of an unknown size 1while loop 2do while loop 3for (type variable:listOrSet) loop 4while-do loop

3while do is an invalid loop. Although while, do-while or For (initialize;condition;increment) loop can be used to traverss through a list or set, the size will beed to be explicitly determined by calling size() method, which does not conform to the contexr of the question where size is unknown A for (type variable:listOrSet) loop will naturally traverse through the collection without knowing its size. for example : for (Account a: AcctList)

a dev is required to ensure that a reason is entered if an opp stage is updated to closed. What is best way to do this? 1. required field 2. workkflow rule 3. apex trigger 4. validation rule

4 a validation rule can be used to check both the stage and reason fields of an oppportunity during the update. If the stage is set to closed, and the reason field empty, then validation rule can display error message the reuirement cna bee met using a declaritive tool, so there is no need to use apex trigger. Workflow rule cannot be useed to validate field data. setting the field to required will require that field to always be populated regardless of opportunity stage

what method can be used to obtain metadata info about all the sobjects in an org and their fields 1describeSobject() 2describeObjects() 3getGlobalSObjects() 4getGlobalDescribe()

4 getGlobalDescribe() method can be used to return a map of all sobject names(keys) to sobject tokens(values) for the standard and custom objects defined in an org. the describesobjects() can be used to obtain metadata (field list and object properties) from a specified sobject or array of sobjects. the sobjects need to be specified when using this method. there are no methods names describeobjand get globalsobj

a company wants to generate incoives in salesforce, allow cusotmers to pay their invoice securely from their email, and process the payment. which of the follwing should be used 1 build a custom apex solution 2 use lightning process builder 3 use workflow rule and forumla fields 4 check if appexchange app exists

4 in this case, it would be better to look for an existing appexchange app that offers the functionality required by the company. native features in salesforce, ie process builder, workflow rule, form fields, cannot be used for allowing customers to pay from their email and processing their payment. several free solutions that offer features related to payment processing are available in the appexchange, which makes using an existing app better than commiting resources for the developemnt of a custom app that uses apex code

which is required when defining apex class method 1 definition modifiers 2access modifiers 3input paramsaters 4return data type

4 Access modifiers such as 'public' or 'protected' are optional. Definition modifiers such as 'virtual' and 'abstract' are optional for defining an Apex class or method. The data type of the value returned by the method is required; void can be used if the method does not return a value. A list of input parameters can be specified for the method. The parameters should be enclosed in parentheses () and separated by commas, each preceded by its data type. If there are no parameters, an empty set of parentheses can be used.

A developer needs to retrieve the Contact records with a last name that starts with 'Ab'. What code in the options below will satisfy his requirements? 1SELECT Id, LastName FROM Contact WHERE LastName IN ('Ab') 2SELECT Id, LastName FROM Contact WHERE LastName = 'Ab%' 3SELECT Id, LastName FROM Contact WHERE LastName LIKE '_Ab' 4SELECT Id, LastName FROM Contact WHERE LastName LIKE 'Ab%'

4 The % and _ wildcards are supported for the LIKE operator. The % wildcard matches zero or more characters. The _ wildcard matches exactly one character. The IN clause returns records where the field have an exact match in any of the values specified in the IN array. The "LastName LIKE '_Ab'" criteria will match three-letter values that end in 'Ab'. The "LastName = 'Ab%'" filter will treat % as a literal character and not as a wildcard character.

The system administrator of Cosmic Solutions is building a flow that should be triggered after an account record is updated. When the rating of an account record changes to 'Hot', the flow should automatically send an email to the account manager and send related data to an enterprise resource planning system using Apex code. When the rating changes to 'Cold', it should only send an email to the account manager. Which of the following represents the correct way of configuring the outcomes in the 'Decision' element of the flow for this use case? 1. Each outcome should include a condition that checks a custom field that stores the previous value of the 'Rating' field. 2. Each outcome should be configured to check if the value of the $CHANGED resource is true. 3. Each outcome in the element should be configured to execute 'if the condition requirements are met'. 4. Each outcome in the element should be configured to execute 'only if the record that triggered the flow to run is updated to meet the condition requirements'.

4 When configuring an outcome in the 'Decision' element of a flow, the following two options are available for executing the outcome: 1) If the condition requirements are met 2) Only if the record that triggered the flow to run is updated to meet the condition requirements The first option executes the outcome if the condition requirements are met regardless of the previous and new field values. The second option allows executing the outcome only if the record changes from not meeting the condition requirements to meeting them. This option, which is similar to the ISCHANGED function found in Workflow Rules and Process Builder, can be used to execute an outcome only if the value of a field changes. It can be used for this requirement to execute two different outcomes based on whether the value of the 'Rating' field changes to 'Hot' or 'Cold'. There is no $CHANGED resource that can be utilized in the outcome conditions for this requirement. It is better to use an existing option in the 'Decision' element instead of creating a custom field that stores the previous value of the field. Such a solution would also require a Workflow Rule that updates the field.

The sales and support agents of Cosmic Supermarket frequently create account records manually in Salesforce. If the 'Billing State' of a new account is New York, then an email should be sent immediately to the manager of the account owner. In addition, a new task should be created and assigned to the account owner to reach out to the primary contact associated with the account. However, the task should only be created one week after the creation of the account. An administrator has decided to build a record-triggered flow for this requirement. What can be added to the flow to create the task record at a dynamically scheduled time? 1 apex action 2 trigger 3 time dependent action 4 scheduled path

4 a part of the record triggered flow can be run at dunamically scheudled time after the triggering event occurs by adding a scheduled path to the flow. to meet this req, a scheduled path can be added and connected to a create records elt to create a task record 7 days after the created date of a new acct record. an email alert can be sent to the account owners manager immediately. using apex isnt necesary to schedule the creation of the task record. it isnt possible to add a trigger to the flow. time dep. actions are avail in workflow rules to schedule the exetion of field updates, email alerts, task creation, or outbound messages

there is a requirement that when an opportunity is closed, commision records should be created automatically for each member of the opp team. the commision custom object has a numeric field wherein its value is calculated based on the role of the member, time to close the deal, and type and value of the opp. how could this be achieved/ 1 workflow rule 2 apex trigger 3process builder 4 flow builder

4 an autolaunched flow can be configured to automatically start when an opp is closed, create the commission records, as well as perform the logic required to compute the commission values. workflow rules cannot create records. although process builder can be used to create a record, it is not capable of creating multiple records dynamically. an apex trigger is not needed as this can be done declaratively

an assignment statement is any statement that places a value into a variable. which of the following expressions is a valid assignment stmt 1. String a = new String ('SampleString'); 2. List<Contact> conList= new [SELECT Id FROM Contact]; 3. Map <Id,Account>=[SELECT Id, Name FROM account]; 4 Account acct= new Account();

4 in the correct answer, a new acct object is initialized to the acct variable, however, this is the way the other options should be String a = 'sampleString'; Map<Id, Account> mapAcc = new Map<Id, Account>([SELECT Id, Name FROM Account]); List<Contact> conList = [SELECT Id FROM Contact];

how can a dev check if the current user is able to view a particular field 1 use the isViewable() method of the DescribeFieldResult Class 2. use the isViewable() method of the DescribeField Class 3 use the isAccessible() method of the DescribeField Class 4 use the isAccessible() method of the DescribeFieldResult Class

4 the isAccessible method of the describefieldresult class returns true if the current user can see the field

sam has completed a solution desgin and is ready to create the data model for a new application in sf. there are a number of custom objest, each with a number of custom fields and relationships bt the custom objects. what would you suggest to complete the task most efficiently 1 Use the Schema Builder to create custom objects and fields, and then create relationships in Setup via Create->Objects 2 Create the Custom objects, fields, and relationships in Setup via Create->Objects and use the Schema Builder to verify that the data model was created correctly. 3 Use the Create Custom Field in Setup to create objects, fields, and relationships 4 Use the Schema Builder to create custom objects, fields, and relationships

4 Schema Builder can be used to efficiently create a number of objects, fields, and relationships in less time than creating the objects

a dev has created the following before update trigger on the Opp object to update the value of a field on a newly updated opps automatically. what will Status__c field be is a sales rep wins a sales feal and closes the corresponding opp record in salesforce. trigger OpportunityTrigger on Opportunity (before update) { for (Opportunity opp : Trigger.new) { switch on opp.StageName { when 'New' { opp.Status__c = 'New'; } when 'Closed Won' { opp.Status__c = 'Order Required'; } when 'Closed Lost' { opp.Status__c = 'Cancelled'; } when else { opp.Status__c = 'Awaiting Closure'; } } } } 1 closed 2 closed won 3 awaiting closure 4 order required

4. In this case, the developer has used a switch statement to test an expression against several values. After winning a sales deal, when the value of the 'StageName' field on an opportunity is set to 'Closed Won' by a sales representative, the value of the 'Status__c' field on the opportunity is automatically updated to 'Order Required' once the code block for the 'when' value of 'Closed Won' is executed. The other 'when' values within the switch statement are ignored.

Cosmic Lights uses the standard Contact object to store information about people associated with B2B companies that purchase the products manufactured by the company. A custom object is used to store information about sales orders. When a person associated with a company purchases a product, a custom field on that person's contact record is updated by a salesperson manually. When this field is updated, a Salesforce survey should be sent to the person to gather certain information, such as the reason behind the purchase and how their previous purchases influenced the recent purchase decision. What solution should be recommended to meet this requirement? 1. create a flow to send survey invitation to the contact automatically when the value of the custom field changes 2. create an apex trigger that sends survey invitation to the contact when the value of the field changes 3. create a workflow rule that sends outbound messages to a 3rd party survey application when the value of the custom field changes 4. createa process that executes an action type called send survey invitatio when the value of the custom field hanges

4. a rpcoess can be created using process buolder to execute an action type called send survey invitation. this action type can be utilized to automatically email survey invitation to leads, contacts, or users. in this case, the process can be triggered automatically when the value of the custom field changes. using process is a better solution that relying on an outbound message and a third party system. it is also better to meet thiss reuirement declaritivelty insted of using an apex trigger. although flow may be used, it isnt needed bc process can do it.

using the controller class below, what is the result after the follwing script is run "ItemController i = new ItemController(); i.populate();" public class ItemController { public void populate() { Item__c a = new Item__c(Name = 'New Item'); Database.insert(a, false); // partial success for (Integer x = 0; x < 150; x++) { Item__c b = new Item__c(Name = 'New Item'); try { insert b; } catch (Exception e) { System.debug('DML limit reached'); } } } } 1. only first record is created bc partial success is allowed 2. class cant be instantiaed bc theres not cunstructor defined 3. dml limit reached printed in debug log 4. no records are created

4. no records will be created. total number of dml stmts is 151 which exceeds gov lim of 150. since limit is exceeded, all changes are rolled back. gov limit exceptions cant be handled. So, exception handler in for loop will never be called. even though partial success is set in first stmt, the record it created will be rolled back bc its part of same transaction. constructors arent required in controllers, so class can be instantiated

What will be the output if the code below is executed when the value of testRawScore variable is 75? if (testRawScore >= 90) { gradeEqual = 'A'; } if (testRawScore >= 80) { gradeEqual = 'B'; } if (testRawScore >= 70) { gradeEqual = 'C'; } if (testRawScore >= 60) { gradeEqual = 'D'; } System.debug('Value of gradeEqual = ' + gradeEqual); 1 value of gradeequal=A 2 value of gradeequal=b 3 value of gradeequal=c 4. value of gradeequal=d

4. since there is no ELSE stmt in the code, the IF stmts will continue to be evaluated, even if one of the conditions is met. since the value of testRawScore(75) is greater than 70, the code within the third IF stmt assigns the value C to gradeequal. but since 75 is also greater 60, the last if stmt assigns the value d to gradeequal, replacing the previous value. as a result, the final value of gradeequal variable is D

A developer has written the following Apex code statement to obtain the describe result for an sObject in Salesforce: Which of the following methods can be used to return a map of developer names of the record types associated with the sObject and their metadata information? Schema.DescribeSObjectResult dsr = Schema.SObjectType.Account; 1. getrecordtypeinfosbyname() 2. getrecordtypes() 3. getrecordtypeinfos() 4. getrecordtypeinfosbydevelopername()

4. the getrecordtypeinfosbydevelopername() method of class describesobjectresult returns a map that matches dev names to their assoc types. the getrecord typeinfos method returns a list of the record types, and the getrecordtypeinfosbyname() returns a map that matches the record label to their assoc record types.

A Salesforce developer noticed that an Apex method used in their custom Contact management application has been throwing null pointer exceptions on certain occasions. Upon investigating, it was identified that the error was due to code that accesses the Account field of a Contact record, which is not associated with an account, and executes the 'isSet' method on the Account sObject. Given a snippet of the code below, which of the following options can be used to avoid the exception? public static void assignPrimaryContact() { Contact con = getContact(); Boolean hasAssigned = con.Account.isSet('Has_Primary_Contact__c '); // ... } 1.Boolean hasAssigned = getContact().Account:Account.Has_Primary_Contact__c?null; 2. Boolean hasAssigned = getContact().Account?Account.Has_Primary_Contact__c:null; 3. Boolean hasAssigned = getContact().Account.?isSet('Has_Primary_Contact__c '); 4. Boolean hasAssigned = getContact().Account?.isSet('Has_Primary_Contact__c ');

4. the safe nav op can be used for replacing explicit checks for null references and uses the syntax (?.) if left hand side of op evals to null, null is ret. otherwie, right hand side, which can be method, var, or property, is chained to left hand side of op and returned. in this case, the chained value is the isSet method. in the correct answer, the resulting value is getContact.Account.isSet('Has_primary_Contact__c') is the contact is related to an acct. the other option contain invalid syntax or return vals

dev is required to overrid the standard opportunity view button using a visualforce pge. what should the dev do? 1 use a custom controller and replicate the opp detail page 2 use standardlistcontroller 3 use a controller exxtension 4 use opportunity standard controller

4. when overriding buttons with a VF page, you must use the standard controller for the object on which the button appears. for example, if you want to use a page to overide the view button on opportunity, the page markup must include the standardController="opportunitty" attribute on the <apex:page> tag. a controller extension can also be used when you need to add extra fuctionality to the visualforce page you are using as an override

a salesforce dev at cosmic solutions is designing custom mass import tool of accounts. in order to efficiently process bulk inserts, she is using Database.Insert() so she can take advantage of its partial succedd option. after executing database.insert(), she needs to identify wich accts failed to insert, so that the failures can be logged appropriately. which statement is true about acessing the results of database.insert()? 1.the returned map uses the originall sobjects as keys for the saveresult values 2. calling getdatabaseresult() on any of the original sobjects returns the corresponding SaveResult object 3. calling database.getResult(originalSObjectRecord) returns the corresponding SaveResult object 4. each saveResult in the returned List has the same index as the corresponding record in the original list has the same index as the corresponding record in the original sObject List

4. when partial success is allowed, the database.insert method returns a list of SaveResult objects. the results list corresponds index by index to the original list of sobject records passed into database.insert(). each Saveresult record contains information about each records insert attempt, such as if it was succesful/not, and list of errors if the record failed to insert. database.getResult() and [sObjectRecord].getDatabaseResult() are not valid methods. the Database.insert() call does not return a Map of results, it returns a List.

which is valid assignemnt 1. String alphabet = "abc" 2 Map oppMap = [Select Id, Name, stagename from Opportunity] 3. private static constant Double rate = 7.75 4. Lead[] LeadList= new List<Lead>()

4. when working with soql queries, maps can be populated from the results retuned by the soql query. the map key should be declared with an ID or String data type, and the Map value should be declared as an sobject data type. correct way: Map<Id, Opportunity> oppMap = new Map<Id, Opportunity>([Select id, name, etc From Opportunity]) A string can be declared as any set of chars surrounded by SINGLE quotes when declaring a var as constant, final can be used, it indicated that the variable will be assigned to a value no more than once. ie static final double rate=7.2

which of the following is a standard controller action that aborts an edit operation 1 close 2. save 3. delete 4. cancel

4. cancel the CANCEL action abort and edit operation. after this op is finished, the cancel action returns the user to the page where the user originally invoked the edit.

total heap size gov limit sychronous: asucnh:

6 mb 12 mb (ie memeory allocated to list frows too large)

String is one of the primitive data types in Salesforce. Given the following options, what is a valid value that a string data type variable can contain? A. 'Salesforce' B. TRUE C. "Salesforce" D. 3.14159

A String is any set of characters surrounded by single quotes. double quotes cannot be used in a string type as it will cause an error and it is not the standard notation for string declaration in apex

Apex and Visualforce pages are prone to Data Access Control issues such as exposing sensitive data that are normally hidden from users, to avoid this, a developer should: A. Use the [with sharing] keyword in Apex classes B. Use the [without sharing] keyword in Apex classes C. Use the [shareable] keyword in Apex classes D. Use the [non shareable] keyword in Apex classes

A. when using an apex class, the built in user permissions and field level security restrictions are not respected during execution. the solution is ot use the qualifying keywords 'with sharing' when declaring the class. the with sharing keyword directs the platform to use the security sharing permissions of the current user rather than granting permission to all records.

A flow is created based on the result of a complex computation involving a set of records. The records need to be retrieved using a query that requires multiple subquesries, where the results are processed and evaluatex using complex busniness logic. The outcome of the computation determines the next step the flow should take.

An apex class can be created using @invocable method that executes the necessary SOQL query for retrieving the records, processes the results based on the required logic, and returns the outcome. The Apex method can be invoked by the flow.

Which 2 programming models are avaioable for building lightning components>

Aura and lightning web comoponents lwc

A custom controller is an Apex class that implements all of the logic for a page without leveraging a standard controller. When does a developer NOT need to use a custom controller? A. Overriding existing standard functionality B. Run the Visualforce page entirely in system mode C. Using object record pagination. D. Make a callout to an external web service

C. the standardListController is used for displaying or working on a set of records and comes with build in pagination feature such as next and previous actions for browsing record lists. overriding or extending standard funcionality, runningg visualforce pages in system mode, and performing callous require a custom controller

What can be written as an apex class to specify logic for a visualfroce page>

Custom Controller

When a cross object formula references currency fields of a different currency to that on the record where the formula is used, salesforce randomly picks a currency to use, T/F? In other words, when cross object formula references some currency field on a different object, and that currency field uses a different type of currency than the one on the object where the formula is used, salesforce will pick a randome currency to use

False cross abject formulas that reference other currency fields convert the value to the currency of the record that contains the formula

What clause can be used to filter results returned by an aggragate function in SOQL query?

HAVING clause

how is a many to many rel created

Use a junction object, make it be the detail of 2 master detail relationships, one for each object

A PageReference is a reference to an instantiation of a page. Which of the following are valid means of instantiating a PageReference? There are 2 correct answers a. ApexPages.Page().existingPageName b. Page.existingPageName c. PageReference pageRef = newPageReference('URL') d. PageReference.page('URL')

a,b use page.existingpagename to refer to a pagereference for a visualforce page that has already been saved in your organization. creates a pagereference to any page that is hosted on the force.com platform by using pagereference pageref=new pagereference(URL) you can also instantiate a pagereference object for the current page with the currentPage ApexPages pageref=apexpages.currentpages();

A salesforce user wants to build a custom user interface for internal users. The interface will contain fields pulled from different salesforce objects. Some of which are not related. Choose best answer. 1. Build a custom page layout in salesforce containing the required information 2. develope an application using heroku and embed it in the saleforce org 3. develop a visualforce page to display fields from the different objects 4. build a page using dynamic forms and field section lightning components

answer: 3 since the custom user interface is for internal use only and needs to pull in salesforce data from different objects, a programmatic solution such as visual force page or custom lightning component is required. A page layout cannot display fields from unrelated objects. Heroku is best used for customer facing sites. Dynamic forms and field section lightning components are supported in lightning recorrds pages only and support fields that are related to the primary record

select true 1 when a master detail relationship is defined, data from the master or detail object cna apear as a custom related list on page layouts for the other object 2 when a many to many relationship is defined bt objects a and b using a junction obejct, data from the junction object can appear in a related list on the page layouts of objects a and b 3when a lookup rel to object b is defined on object a, data from object b can appear in a related list on page layoutsof object a 4when lookup rel to parent object b is defined on child object a, data from object a can appear as a related list on page layouts of object b

b,d when a lookup rela is defined, sata from the lookup object can be displayed in a custom related list on the other object. forexmple, if a custom object named schedule is related to a custom object named course, a list of related schedule records can be displayed on the training course record page. when a many to many rel is defined, object from a junction object can be displayed on page layouts for either object.

a developer has a requirement to provide round robin lead assignment functionality. the assgnment rules should be driven by settings available to a user in the UI. what could be used for this 1. a managed package that provides the functionality and modify it 2. find an unmanaged package that provides the funstionlty and modify it 3. create a vf page that uses an apex controller and modify it to provide the functionality 4 create an unmanaged package that uses apex and include it in a visualforce page

if an unmanaged package can be found that uncludes most of the functionality, it could be customized to suit the exact requirements, instead of starting from scratch. managed packages cant be modified. if dev. is started from scratch, a new visualforce page that uses a custom controller would be required

which operations can be performed on external objects from a process?

lookup, create, or update external objects

flows can start by/from when___ what it can do

record create. update, deleete, platform event, process builder, schedule, button, link, flow builder, apex, utility bar, visualforce page, community page, lighning page, custom tab immediatelty, scheduled, resumed accept user input, cALL apex, create records, deleete recorss, post to chatter, send email,. submit for approval, query records, loop records, upload files, display address form, insrt imges in flow screen, send custom notification, update fields in any record, quick action, multiple decisions, lookup records

proceass can start by/from when___ what it can do

record create. update, platform event, another process immediatelty, delayed create records, update fields, update related records, submit for approval, send email alert, call a flow, post to chatter, call apex, call quick action, invoke another process, send custom notification, send survey invitiation

what external web based platform cna be used to query, insert, update, and delete saleforce data

workbench

List 3 declarative application building blocks of business logic declaritive, so not apex code

workflow validatoin rules approval process

aut-tools acts as a single if then statement

workflow and approvals

WHICH automation tool cna be used to send autbound messages**check

workflows and approval processes can send outbound

which declarative tool can be used to performautomated actions inSF

workkflow, process, validation rule, flow


Kaugnay na mga set ng pag-aaral

Musculoskeletal Disorders Prep U

View Set

Respiratory System and Gas Exchange

View Set

HST 206 Study Guide for the midterm

View Set

Chapter 31: Health Supervision (Prep U)

View Set

Chapter 13: Care of the Patient with a Sensory Disorder

View Set