Process and Automation Flashcards

1
Q

What is heap size?

A

Heap size in actual is the count of memory used by the variables, object instances in an Apex class. In order to store these objects & variables, memory is allocated in Salesforce which is derived from allocated Heap

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What DML operation will allow other records in a list to be inserted even if there are records that failed?

A

Database.Insert(sObjectsToCreate,false);

-dml statements have that allornone parameter that can be set to false to allow for partial success

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which tasks are best achieved using process builder instead of workflow rules?

  • copying the account postal code to all child contacts
  • field update on parent object
  • submitting an order for approval
  • creating tasks at multiple intervals
A

Both can create task records at multiple intervals and both can update fields on parent records. (master-detail is required for workflow rules)
Only a process can submit a record for approval and update CHILD records.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which of the following are valid Apex expressions?

  • @future
  • 7=true
  • new List()
  • 3+4
  • myClass.myMethod()
A

-new List()
- 3+4
-myClass.myMethod()
these are all valid apex methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Apex expressions can be…

A
  • a literal expression
  • a new sObject
  • Apex object
  • list
  • set
  • map
  • static/instance method invocation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is @future in Apex?

A

An annotation to identify methods that are executed asynchronously

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What primitive data types are used with numbers in Apex?

A
  • Decimal
  • Integer
  • Long
  • Double
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How are variables declared in Apex?

A
Integer i = 0;
String str;
List strList;
Set s;
Map m;
Multiple variables are declared using comma separation:
Integer i, j, k;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What value do Apex variables have if a value is not assigned?

A

All apex values are initialized to null if they are not explicitly initialized.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Are SOSL and SOQL statements case-sensitive?

A

No, SOSL and SOQL are case- insensitive

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is true when defining Apex classes?

A
  • It is required to specify an access modifier inn declaring top-level class
  • it is optional to specify an access modifier in declaring inner class
  • the keyword [class] followed by the name of the class is necessary
  • a developer may add optional extensions and/or implementations
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are reasons for using a static method or variable?

A
  • To store information that is shared across instances of a class
  • To create a utility method in a class
  • To use a method or variable without instantiating its class
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What standard objects do NOT support DML statements?

A
ApexComponent
ApexPage
BusinessHours
BusinessProcess
CategoryNode
CurrencyType
DatedConversionRate
ProcessInstance
Profile
RecordType
SelfServiceUser
StaticResource
Territory2
UserAccountTeamMember
UserPreference
UserTerritory
WebLink
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a valid way of referencing or instantiating a PageReference?

A
  • Page.existingPageName;

- PageReference pageRef = new PageReference(‘URL’);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is an ENUM data type?

A

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 Enum to specify a set of constants.
(EX: Enum Day{SUNDAY, MONDAY, …SATURDAY}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Email-to-Case can only be used on what kind of object?

A

a standard object. it will create a new case from an email sent to a specific address
-Email to custom Object is not an existing feature

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What can a Custom Email Handler do?

A

A custom email handler can be defined to handle inbound emails and perform operations such as creating or updating records based on email content.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Which optional clause can be added to a SOSL query to specify the information returned in the text search result?

A

RETURNING

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What are some valid escape sequences that can be used in queries to allow the query to contain special characters?

A
  • ' (one single-quote character)
  • " (one double-quote character)
  • \n (new line)
  • \ (Backslash)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Records with locations saved in geolocation or address fields as individual latitude and longitude values can be retrieved by appending what to the field name?

A

they would be appended with __s instead of the usual __c.

EX: ‘latitude__s’ or ‘longitude__s’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What can be assumed from this expression?

private static final integer number numberOfStudents = 25

A

a variable named numberOfStudents that has a constant (STATIC, FINAL) value of 25 (INTEGER) and is accessible only within (PRIVATE) the apex class which it is defined.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

If a variable is declared in a Global or Public class, where can the variable be accessed?

A

the variable can be accessed inside and outside of the class

23
Q

If a variable is declared in a Protected class, where can that variable be accessed?

A

They are accessible within the class and by classes that extend the class where they are defined in

24
Q

What is the correct syntax for a Do While loop?

A

do{statement} while(Boolean_condition);

25
Q

What is true regarding delete and undelete DML operations?

A
  • all custom lookup relationships that have not been replaced can be restored
  • In a master -detail relationship, child records are deleted when the parent record is deleted
  • parent and child account records are supported by the undelete operation
26
Q

What would a developer use to send record information to a legacy system when a criterion is met?

A

Outbound message
- they use the notifications() call to send SOAP messages over HTTP(S) to a designated endpoint when triggered by a workflow rule or a record triggered flow.
(note if declarative solution is required for outbound messaging, a flow or workflow rule can be used; process builder would need to invoke Apex code to do the same)

27
Q

What is an Apex constructor?

A

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 and should not return a value. (EX: 2nd line is the constructor)

public class sampleClass() {
      public sampleClass() {
           //logic here
}
}
28
Q

How can a developer access a static variable named TaxRate declared in a different Apex class named TaxCalculation?

A

TaxCalculation.TaxRate

static variables declared in an apex class can be directly accessed without instantiating using the ClassName.StaticVariableName syntax.

29
Q

A static method or variable does not require ______ to run

A

a static method or variable does not require AN INSTANCE OF THE CLASS in order to run

30
Q

What are some valid uses of Apex code?

A
  • Server-side calls from custom Lightning Components
  • Triggers
  • Web Service
  • email services
  • complex business processes not supported by workflow
  • custom transactional logic
31
Q

lightning components use ___ on the client-side and ___ to make calls to the server-side.

A

lightning components use JAVASCRIPT on the client-side and APEX to make calls to the server-side.

32
Q

All Apex code runs in what mode?

A

all apex code runs in System mode where permissions and record sharing of the current user are not taken into account

33
Q

What can execute Apex code as the current user?

A

Anonymous code blocks run code as the current user, meaning it enforces the user’s sharing permissions.

34
Q

What are valid ways to declare a collection variable?

A
  • new Map()
  • new List()
  • new Account[]{}
  • new Set()
35
Q

What are some practices that help keep heap size low?

A
  • use SOQL for loops to process query results
  • if iterating over collections, remove items from the collection once you process them
  • use the ‘transient’ keyword for variables
36
Q

what does the ‘transient’ keyword do?

A

the ‘transient’ keyword tells the system that the instance variable does not need to be saved and keeps it from getting transmitted in the view state

37
Q

what is required when defining an Apex class method?

A
  • return type
    the data type of the value returned by an Apex method is required; the void return type can be used if the method does not return a value.
38
Q

What can be used to update existing standard and custom fields on child records automatically when a parent record is modified?

A
  • Process builder
  • Apex trigger
  • Flow builder
39
Q

How would a developer write a query to return the number of leads for each lead source?

A

SELECT LeadSource, COUNT(Name) FROM Lead GROUP BY LeadSource

40
Q

Workflow rules cannot operate on ___ records of an object

A

workflow rules cannot operate on CHILD records of an object

41
Q

the ‘static’ keyword can be used for…?

A

‘static’ can only be used with methods, variables, and initialization code, not with classes

42
Q

If a limit is set on a SOSL query, how are the results distributed?

A

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

43
Q

What are Trace Flags?

A

trace flags filter the logs generated by the transaction. It contains debug level, start-end time, type of the log (ERROR, WARN, DEBUG), and the status of the job/transactions.

44
Q

What scopes can trace flags work?

A

query, session, and global

45
Q

What action in the Process Builder can be used to publish a platform event message?

A

Create a record

46
Q

What element in Flow Builder can be used to publish a platform event?

A

Create Records

47
Q

What apex method is used to programmatically publish an event?

A

EventBus.publish()

more than one event can be published by adding the events to a list and passing the list to this method

48
Q

What object is returned by the EventBus.publish() method?

A

The Database.SaveResult object

It contains the result of the publishing

49
Q

What object returns the errors of an EventBus.publish() method?

A

errors are returned in the Database.Error object

50
Q

What kind of flow can subscribe to a platform event?

A

a platform event-triggered flow will automatically launch itself when it receives a platform event message

51
Q

What do lightning components use to make server-side calls?

A

Apex

52
Q

What would cause an Apex trigger to be fired twice in a single execution?

A

if the same object has a workflow that updates a field, then the before and after triggers are run a second time

53
Q

How are bind expressions formed in SOQL?

A

By adding a colon (:) before variables. a bind expression can be used along with the IN or NOT IN operator to reference a set or list in a SOQL query