Salesforce Platform Developer II PD2

When should I use a continuation class over an @future class?

When a visualforce page has a controller has a need to have 10+ conncurrent callouts to an external service that could take more than 5 seconds and you need to display that data on the page as it becomes available.

What is the return type of a sosl query and what does it return if the no records are found?

List<List<sObject>> , it will return an empty Lists of the specified objects in the sosl query.

What is the general syntax of a sosl query in apex vs in the rest api.

Sosl: FIND '<searchstring>*' IN <fields> RETURNING <object>(field1,field2),<object>,<object>
Sosl api: FIND {<searchstring>*}IN <fields> RETURNING <object>(field1,field2),<object>,<object>

What must I use to build visual workflows? Does a visual workflow require user interaction to execute?

Cloud flow designer,no

Which 4 field types are you allowed to make an external ID so that it gets indexed?

AutoNumber,Email,Number,Text

Name the fields 8 fields salesforce keeps an index of. (lendrisc)

RecordTypeId,
Division,
CreatedDate,
Systemmodstamp(LastModifiedDate),
Name,
Email(maybe),
Lookups&MD,
Id

List 4 method for reducing the viewstate

1. Reduce Components 2. Use transient variables 3. Use javascript remoting 4. Use the streaming API

Can triggers access invokable methods? Can you use multiple annotations and/or have multiple invokable methods in a class?

No

Name 8 standard fields with database indexes

1. Id 2. Name 3. OwnerId 4. CreatedDate 5.SystemModstamp 6.RecordTypeId 7.MasterDetail 8. Lookup fields

How can I make a custom field database indexed?

Make it a unique field or an external id

What % of records are indexed when <= million records are returned for a Standard Index. What is it for a custom index?

Standard is 30% of first threshold 15% second, Custom is 10% of first threshold 5% second.

Name 4 selectivity index exceptions which will keep your query from being indexed

1. != Excludes Not Like 2. text fields with < or > 3. Like'%string%' or contains in list views 4. Non determanistic formula fields(cross object).

Name all the trigger context variables

CRUD(isInsert,isUpdate,isDelete,isUndelete) Context(isBefore,isAfter,isExecuting) Collection(Trigger.new,Trigger.newMap,Trigger.old,Trigger.oldMap,

Name all primitive data types in salesforce

--Integer,Decimal,Double,Long --Blob --Boolean --Date,Datetime,Time --String,Id --Object (non-standard AnyType is used when valueOf static method is invoked and Currency.newInstance creates a literal when using for Soql/Sosl in where clauses

What must be enabled on custom objects to have an audit trail(history retention policy) on fields?

Field history tracking

Name 10 fields which cannot be tracked in history retention policies

--formula,rollup,autonumbered --createdBy,LastModifiedBy,ExpectedRevenue on opps --Master Solution Title,Master Solution Details on solutions --Long Text, Multi-select

Which sObjects Can have history retention policies and what must be enabled to have one?

Field Audit Trail --Accounts,Cases,Contacts,Leads,Opportunities, Assets,Entitlements, Service Contracts,Contract Line Items,Solutions,Products,PriceBooks,CustomObjects

When using the streaming API, how do I define a channel?

Create a PushTopic based on a soql query.

What must a PushTopic query include?

Select must include Id, One entity per query, and object must be valid for that api version

When referencing a compound field in a PushTopic what must be included?

For Name field: Constituents of a compound field are optional but the compound field is not. This is not allowed: Select Id,firstname,lastname
This is ok Select Id,Name,firstname,lastname
For Address or Geolocation: Contstituents must always be referenced

What is NOT allowed in a soql pushtopic query

No Id, semi and anti joins, Aggregates,LIMIT,Relationships(id only),Text Area searches, OrderBy,GroupBy,NOT but NOT IN(issupported),Offset,Typeof,

Which replay option gives notifications for all new events after a subscription and previous with the 24-hour window?

-2

What are all the options you can gives as a replay option when subscribing to a channel?

either replayId, -1, or -2

An invocable method must be static, when should you use public or global?

use global when you want to access an action in a managed package.

What inputs does an @InvocableMethod require and how are triggers affected? Which name do you use when calling an action with the @InvocableMethod ?

List or List of Lists of primitives or variables with the @InvocableVariable. You use the class name to call the action not the method name.

If I want to get details about a field on a particular object like Account what is the result type?

Schema.DescribeFieldResult

If I want to get details about an object on an object like Account what is the result type?

Schema.DescribeSObjectResult

What would a schema call look like to get a list of standard fields on the Account object

Schema.SObjectType.Account.fields

Where can I NOT use lightning data services?

1. When in a lightning component in visualforce 2. communities 3. lightning out

Where can an @future annotation not be used in an VF controller?

getter, setter,constructor

Where can DML's not be done in a VF controller?

constructor and getters

What does the flow syntax look like when embedded in a VF page?

<flow:interview name="myflow" buttonLocation="bottom"/>

List out the order of execution

Old -New SB- SDSa- AfAsAu WFu (if FuBATriggers S ) PrEsEnR- Sh C
1. old record load
2. new record load
3. System validations
4. Before triggers
5. System validations but not layout specific rules if UI
6. Duplicates
7. Save but not commit
8. After trigger

What's counted in the Apex CPU time limit and what isn't

Counted: All apex code, library functions exposed,Workflow execution
Not Counted:DML,Soql,Sosl,Callouts

Name 4 ways to reduce your CPU timeout period

1. Use map based queries. 2. Use asynchronous like @future or queueable 3. Aggregate Soql 4. Only loop on necessary data

What does the checkpoint inspector help with?

shows objects in memory at a specific point of execution and see what is referencing it.

What tool in the Developer Console contains information on SOQL query Cardinality?

Query Plan Tool

Apex scheduler limits, how many jobs can you have scheduled and how many apex executions can you have in a 24hr period?

100, 250000 or user license*200

How can you make a callout in scheduled apex?

It must be made asynchronously using either @future or queuable apex

What is the maximum soql queries that can be issued in synchronous and asynchronous apex?
maximum sosl?

Sync: 100 , Async: 200 , sosl:20

What are the maximum records you can retrieve from a soql query? Sosl?

50k,2k

Total DML per transaction, Total records that can be processed as a result?

150,10k

Total heap size limit for synchronous and asynchronous

Sync: 6mb, Async:12mb

List the system methods which count against dml limits other than CRUD and database.(crud)when executed...ACER SPR

1. Approval.process
2. Database.convertLead
3. Database.emptyRecycleBin
4. Database.rollback
5.Database.setSavePoint
6. EventBus.publish
7. System.runAs

Total number of http or web service calls in a transaction

100

Maximum @future per transaction

50

Maximum jobs you can add at a time with System.enqueueJob

50

What is the method used to add a certificate to an httprequest?

setClientCertificateName(' ')

What is used to create a custom experience in chatter. ie the namespace

ConnectAPI

How test for an external url in a test class

Instantiate a PageReference then use getUrl();
PageReference page = new

What method returns the number of queries that have been used so far? What returns the total number of queries allowed?

Limits.getQueries,Limits.getLimitQueries()

Developer is creating a custom app and needs to access data in a managed package. What should they use?
A. Static resource
B. Custom Object
C. Custom Settings
D. Utility Apex Class
E. Custom Metadata

E

Where is social sign-on not available for use?

Sites or Communities

The progress of an apex job queued is using the System.enqueueJob method and needs to be monitored. Which are valid option
A. Use the Apex Jobs page in setup
B. Query the Queueable Apex record
C. Query the AsyncApexJob record
D. Use the Scheduled jobs pag

A. C.

Which are relevant pratices while analyzing the timeline of different types of transactions in the execution overview panel?
A. Log lines in the execution log panel can be analyzed for details about specific events
B. The performance tree shuld beuse dto

a. d.

How can you check if a list will contain more than 10k records programmatically.

Call getCompleteResult() if false it won't be able to process the call

Where can the webservice annotation be used in a class?

Top level outer class static methods,inner and outer classes on variables

Which objects let you add tests and schedule them at specific times to the Apex job queue and check the results asynchronously

Instantiate an ApexTestQueueItem and add an ApexClass test method to it and insert it. With the jobId you can check the ApexTestResult.

When would you use generic streaming with the streaming API and what needs to be defined to use it?

Use when you want to track events not tied to data changes. You need a streaming channel with one or more clients subscribed to it and you can use the streaming channel push api to monitor and invoke push events.

In a project xml how do I define a type which grabs all custom objects

<types><members>*</members><name>CustomObject</name></types>

What does a schema call look like to get details on tab metadata?

List<Schema.DescribeTabSetResult> tab = Schema.describeTabs();

List 5 common causes of non-slective soql queries

1. having too much data
2. Performing large data loads and a large recycle bin
3. % wildcards
4. Using NOT and !=(can't use index on this
5. Complex Joins

What field types can custom indexes not be created for?

multiselect,currency in multicurrency org,long txt, blob

When should I use a continuation class over an @future class?

When a visualforce page has a controller has a need to have 10+ conncurrent callouts to an external service that could take more than 5 seconds and you need to display that data on the page as it becomes available.

What is the return type of a sosl query and what does it return if the no records are found?

List<List<sObject>> , it will return an empty Lists of the specified objects in the sosl query.

What is the general syntax of a sosl query in apex vs in the rest api.

Sosl: FIND '<searchstring>*' IN <fields> RETURNING <object>(field1,field2),<object>,<object>
Sosl api: FIND {<searchstring>*}IN <fields> RETURNING <object>(field1,field2),<object>,<object>

What must I use to build visual workflows? Does a visual workflow require user interaction to execute?

Cloud flow designer,no

Which 4 field types are you allowed to make an external ID so that it gets indexed?

AutoNumber,Email,Number,Text

Name the fields 8 fields salesforce keeps an index of. (lendrisc)

RecordTypeId,
Division,
CreatedDate,
Systemmodstamp(LastModifiedDate),
Name,
Email(maybe),
Lookups&MD,
Id

List 4 method for reducing the viewstate

1. Reduce Components 2. Use transient variables 3. Use javascript remoting 4. Use the streaming API

Can triggers access invokable methods? Can you use multiple annotations and/or have multiple invokable methods in a class?

No

Name 8 standard fields with database indexes

1. Id 2. Name 3. OwnerId 4. CreatedDate 5.SystemModstamp 6.RecordTypeId 7.MasterDetail 8. Lookup fields

How can I make a custom field database indexed?

Make it a unique field or an external id

What % of records are indexed when <= million records are returned for a Standard Index. What is it for a custom index?

Standard is 30% of first threshold 15% second, Custom is 10% of first threshold 5% second.

Name 4 selectivity index exceptions which will keep your query from being indexed

1. != Excludes Not Like 2. text fields with < or > 3. Like'%string%' or contains in list views 4. Non determanistic formula fields(cross object).

Name all the trigger context variables

CRUD(isInsert,isUpdate,isDelete,isUndelete) Context(isBefore,isAfter,isExecuting) Collection(Trigger.new,Trigger.newMap,Trigger.old,Trigger.oldMap,

Name all primitive data types in salesforce

--Integer,Decimal,Double,Long --Blob --Boolean --Date,Datetime,Time --String,Id --Object (non-standard AnyType is used when valueOf static method is invoked and Currency.newInstance creates a literal when using for Soql/Sosl in where clauses

What must be enabled on custom objects to have an audit trail(history retention policy) on fields?

Field history tracking

Name 10 fields which cannot be tracked in history retention policies

#NAME?

Which sObjects Can have history retention policies and what must be enabled to have one?

Field Audit Trail --Accounts,Cases,Contacts,Leads,Opportunities, Assets,Entitlements, Service Contracts,Contract Line Items,Solutions,Products,PriceBooks,CustomObjects

When using the streaming API, how do I define a channel?

Create a PushTopic based on a soql query.

What must a PushTopic query include?

Select must include Id, One entity per query, and object must be valid for that api version

When referencing a compound field in a PushTopic what must be included?

For Name field: Constituents of a compound field are optional but the compound field is not. This is not allowed: Select Id,firstname,lastname
This is ok Select Id,Name,firstname,lastname
For Address or Geolocation: Contstituents must always be referenced

What is NOT allowed in a soql pushtopic query

No Id, semi and anti joins, Aggregates,LIMIT,Relationships(id only),Text Area searches, OrderBy,GroupBy,NOT but NOT IN(issupported),Offset,Typeof,

Which replay option gives notifications for all new events after a subscription and previous with the 24-hour window?

-2

What are all the options you can gives as a replay option when subscribing to a channel?

either replayId, -1, or -2

An invocable method must be static, when should you use public or global?

use global when you want to access an action in a managed package.

What inputs does an @InvocableMethod require and how are triggers affected? Which name do you use when calling an action with the @InvocableMethod ?

List or List of Lists of primitives or variables with the @InvocableVariable. You use the class name to call the action not the method name.

If I want to get details about a field on a particular object like Account what is the result type?

Schema.DescribeFieldResult

If I want to get details about an object on an object like Account what is the result type?

Schema.DescribeSObjectResult

What would a schema call look like to get a list of standard fields on the Account object

Schema.SObjectType.Account.fields

Where can I NOT use lightning data services?

1. When in a lightning component in visualforce 2. communities 3. lightning out

Where can an @future annotation not be used in an VF controller?

getter, setter,constructor

Where can DML's not be done in a VF controller?

constructor and getters

What does the flow syntax look like when embedded in a VF page?

<flow:interview name="myflow" buttonLocation="bottom"/>

List out the order of execution

Old -New SB- SDSa- AfAsAu WFu (if FuBATriggers S ) PrEsEnR- Sh C
1. old record load
2. new record load
3. System validations
4. Before triggers
5. System validations but not layout specific rules if UI
6. Duplicates
7. Save but not commit
8. After trigger

What's counted in the Apex CPU time limit and what isn't

Counted: All apex code, library functions exposed,Workflow execution
Not Counted:DML,Soql,Sosl,Callouts

Name 4 ways to reduce your CPU timeout period

1. Use map based queries. 2. Use asynchronous like @future or queueable 3. Aggregate Soql 4. Only loop on necessary data

What does the checkpoint inspector help with?

shows objects in memory at a specific point of execution and see what is referencing it.

What tool in the Developer Console contains information on SOQL query Cardinality?

Query Plan Tool

Apex scheduler limits, how many jobs can you have scheduled and how many apex executions can you have in a 24hr period?

100, 250000 or user license*200

How can you make a callout in scheduled apex?

It must be made asynchronously using either @future or queuable apex

What is the maximum soql queries that can be issued in synchronous and asynchronous apex?
maximum sosl?

Sync: 100 , Async: 200 , sosl:20

What are the maximum records you can retrieve from a soql query? Sosl?

50k,2k

Total DML per transaction, Total records that can be processed as a result?

150,10k

Total heap size limit for synchronous and asynchronous

Sync: 6mb, Async:12mb

List the system methods which count against dml limits other than CRUD and database.(crud)when executed...ACER SPR

1. Approval.process
2. Database.convertLead
3. Database.emptyRecycleBin
4. Database.rollback
5.Database.setSavePoint
6. EventBus.publish
7. System.runAs

Total number of http or web service calls in a transaction

100

Maximum @future per transaction

50

Maximum jobs you can add at a time with System.enqueueJob

50

What is the method used to add a certificate to an httprequest?

setClientCertificateName(' ')

What is used to create a custom experience in chatter. ie the namespace

ConnectAPI

How test for an external url in a test class

Instantiate a PageReference then use getUrl();
PageReference page = new

What method returns the number of queries that have been used so far? What returns the total number of queries allowed?

Limits.getQueries,Limits.getLimitQueries()

Developer is creating a custom app and needs to access data in a managed package. What should they use?
A. Static resource
B. Custom Object
C. Custom Settings
D. Utility Apex Class
E. Custom Metadata

E

Where is social sign-on not available for use?

Sites or Communities

The progress of an apex job queued is using the System.enqueueJob method and needs to be monitored. Which are valid option
A. Use the Apex Jobs page in setup
B. Query the Queueable Apex record
C. Query the AsyncApexJob record
D. Use the Scheduled jobs pag

A. C.

Which are relevant pratices while analyzing the timeline of different types of transactions in the execution overview panel?
A. Log lines in the execution log panel can be analyzed for details about specific events
B. The performance tree shuld beuse dto

a. d.

How can you check if a list will contain more than 10k records programmatically.

Call getCompleteResult() if false it won't be able to process the call

Where can the webservice annotation be used in a class?

Top level outer class static methods,inner and outer classes on variables

Which objects let you add tests and schedule them at specific times to the Apex job queue and check the results asynchronously

Instantiate an ApexTestQueueItem and add an ApexClass test method to it and insert it. With the jobId you can check the ApexTestResult.

When would you use generic streaming with the streaming API and what needs to be defined to use it?

Use when you want to track events not tied to data changes. You need a streaming channel with one or more clients subscribed to it and you can use the streaming channel push api to monitor and invoke push events.

In a project xml how do I define a type which grabs all custom objects

<types><members>*</members><name>CustomObject</name></types>

What does a schema call look like to get details on tab metadata?

List<Schema.DescribeTabSetResult> tab = Schema.describeTabs();

List 5 common causes of non-slective soql queries

1. having too much data
2. Performing large data loads and a large recycle bin
3. % wildcards
4. Using NOT and !=(can't use index on this
5. Complex Joins

What field types can custom indexes not be created for?

multiselect,currency in multicurrency org,long txt, blob