Data Modeling and Management: 7% Flashcards
What is the difference between Static and Instance methods in Apex
Static methods can be called at any time. To call an instancemethod, you first have to create an instance of the class.
What is the definition of a Set collection
A set is an unordered collection of objects that doesn’t contain any duplicate values
When will you use the set collection type
Use a set when you don’t need to keep track of the order of the elements in the collection, and when the elements are unique and don’t have to be sorted
What is the definition of a Map collection
Maps are collections of key-value pairs, where the keys are of primitive data types. Each unique key maps to a single value
When will you use the map collection type
Use a map when you want to store values that are to be referenced through a key. For example, when you store a list of addresses that correspond to employee IDs.
How do you define a variable as being a constant
Use the final keyword; it indicates that the variable might be assigned to a value no more than once.
What is the definition of SOQL
Salesforce Object Query Language is a query-only language. It uses relationships, not joins for more intuitive navigation of data
What is the definition of SOSL
Salesforce Object Search Language is a simple language for searching across all multiple persisted objects simultaneously. SOSL is similar to Apache Lucene
What is the Geolocation Custom Field
Geolocation is a compound field that counts toward your org’s limits as three custom fields:
1- Latitude
2- Longitude
3-Internal Use
You can run SOQL queries only on a geolocation field’s components
What are some of the limitations of compound fields?
- Compound fields are read-only. To update field values, modify the individual field components
- Compound fields are accessible only through the SOAP and REST APIs. The compound versions of fields aren’t accessible anywhere in the Salesforce user interface
- Although compound fields can be queried with the Location and Address Apex classes, they’re editable only as components of the actual field.
- Individual field components should be used in Visualforce for access or updating field values and exporting data
What is the suffix for the Geolocation compound field?
Append __latitude__s or __longitude__s instead of the usual __c
True or False:
Custom geolocation and location fields on standard addresses are supported with email templates
False, Custom gelocation and location fields on standard addresses are’t supported with email templates
Can you use compound fields in lookup filters?
Yes and No. You can’t use compound fields in lookup filters except to filter distances that are within or not within given ranges
Where can you use distance lookup filters for compound fields?
You can use distance lookup filters only in the Metadata API
What are the 3 formula functions you can use with compound fields?
ISBLANK
ISCHANGED
ISNULL
Which formula functions can you NOT use with compound fields
BLANKVALUE CASE NULLVALUE PRIORVALUE or the equality and comparison operators
True or False: Geolocation fields are supported in custom settings
False. Geoloction fields aren’t supported in custom settings
True or False: Geolocation fields aren’t available in dashboards or Schema Builder
True
True or False: Geolocation fields are not available in Visual Workflow and in formula-based workflow and approvals
False, they are available in Visual Workflow and in formula-based workflow and approvals, but they can’t be used in filter based workflow updates and approvals
Where are DISTANCE formulas (for Geolocation fields) supported in
- Entry criteria for workflow rules and approval processes
- Field update actions in workflow rules and approval processes
- Custom validation rules
- Lookup filters (in the metadata API only)
Where is DISTANCE and GEOLOCATION fields allowed in a SOQL statement?
DISTANCE and GEOLOCATION are supported in WHERE and ORDER BY clauses
DISTANCE is supported in SELECT clauses
Where is DISTANCE and GEOLOCATION not allowed in a SOQL statement
Not allowed in GROUP BY
Which of the following is the correct usage of the GEOLOCATION function and provide the reasons why:
A) DISTANCE(warehouse_location__c, GEOLOCATION(37.775,-122.418), ‘km’)
B) DISTANCE(GEOLOCATION(37.775,-122.418), warehouse_location__c, ‘km’)
The answer is A
When using the GEOLOCATION function in SOQL queries, the geolocation field must precede the latitude and longitude coordinates.
Why will the following query not work?
String units = ‘mi’;
List accountList =
[SELECT ID, Name, BillingLatitude, BillingLongitude
FROM Account
WHERE DISTANCE(My_Location_Field__c, GEOLOCATION(10,10), :units)
Apex bind variables aren’t supported for the units parameter in DISTANCE or GEOLOCATION functions