Security and Access: 20% Flashcards
What are the Elements that you might find in a Formula?
- Literal value: A text string or number you enter that is not calculated or changed. For example, if you have a value that’s always multiplied by 2% of an amount, your formula would contain the literal value of 2% of that amount: ROUND((Amount*0.02), 2)
- Field Reference: Reference the value of another custom or standard field using a merge field.
- Function: A system-defined formula that can require input from you and returns a value or values. For example, TODAY() does not require input but returns the current date. The TEXT(value) function requires your percent, number, or currency input and returns text.
- Operator: A symbol that specifies the type of calculation to perform or the order in which to do it. For example, the + symbol specifies two values should be added. The open and close parentheses specify which expressions you want evaluated first.
- Comments: useful for explaining specific parts of a formula to anyone viewing the formula definition.
What is a Literal Value?
A text string or number you enter that is not calculated or changed. For example, if you have a value that’s always multiplied by 2% of an amount, your formula would contain the literal value of 2% of that amount:
ROUND((Amount*0.02), 2)
This example contains every possible part of a formula:
A function called ROUND used to return a number rounded to a specified number of decimal places.
A field reference called Amount.
An operator, *, that tells the formula builder to multiply the contents of the Amount field by the literal value, 0.02.
A literal number, 0.02. Use the decimal value for all percents. To include actual text in your formula, enclose it in quotes.
The last number 2 in this formula is the input required for the ROUND function that determines the number of decimal places to return.
What are the formula operators and functions, A-H?
+ (Add): Calculates the sum of two values.
- (Subtract): Calculates the difference of two values.
* (Multiply): Multiplies its values.
/ (Divide): Divides its values
^ (Exponentiation): Raises a number to a power of a specified number.
() (Open Parenthesis and Close Parenthesis): specifies that the expressions within the open parenthesis and close parenthesis are evaluated first. All other expressions are evaluated using standard operator precedence.
= and == (Equal): Evaluates if two values are equivalent. The = and == operators are interchangeable.
What is a Function?
A system-defined formula that can require input from you and returns a value or values.
For example, TODAY() does not require input but returns the current date. The TEXT(value) function requires your percent, number, or currency input and returns text.
List an example of a Text Operator you can use in Salesforce Formulas
& (Concatenate)
Connects two or more strings.
For Date and Time Functions, what does ADDMONTHS do?
Returns the date that is the indicated number of months before or after a specified 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.
DATETIMEVALUE Returns a year, month, day, and ___ time value.
Returns a year, month, day, and GMT time value.
In Date and Time Functions, what does DAY do?
Returns a day of the month in the form of a number between 1 and 31.
What function should you use instead of the NOW function if you only want to track time, without a date?
TIMENOW
Returns a time value in GMT representing the current moment.
Example:
IF(ISPICKVAL( Rating , “Hot”), TIMENOW(), TIMEVALUE(CreatedDate))
This formula checks to see if a lead is rated “Hot” and if so, returns the current time. Otherwise it returns the time since someone created the lead.
Tips:
Do not remove the parentheses.
Keep the parentheses empty. They do not need to contain a value.
Use TODAY if you prefer to use a date field.
The displayed value is based on the organization’s Locale settings.
What is the different between BLANKVALUE and ISBLANK?
BLANKVALUE: Determines if an expression has a value and returns a substitute expression if it doesn’t . If the expression has a value, returns the value of the expression.
ISBLANK: Determines if an expression has a value and returns TRUE if it does not. If it contains a value, this function returns FALSE.
What does ISCLONE do?
Checks if the record is a clone of another record and returns TRUE if one item is a clone. Otherwise, returns FALSE.
Which should you use in new formulas?
ISBLANK or ISNULL? How are they different?
IMPORTANT Use ISBLANK instead of ISNULL in new formulas. ISBLANK has the same functionality as ISNULL, but also supports text fields. Salesforce will continue to support ISNULL, so you do not need to change any existing formulas.
What are all the MATH FUNCTIONS that can be used in a formula?
FUNCTION
ABS: Calculates the absolute value of a number. The absolute value of a number is the number without its positive or negative sign.
CEILING: Rounds a number up to the nearest integer, away from zero if negative.
DISTANCE: Calculates the distance between two locations in miles or kilometers.
EXP: Returns a value for e raised to the power of a number you specify.
FLOOR: Returns a number rounded down to the nearest integer, towards zero if negative.
GEOLOCATION: Returns a geolocation based on the provided latitude and longitude. Must be used with the DISTANCE function.
LN: Returns the natural logarithm of a specified number. Natural logarithms are based on the constant e value of 2.71828182845904.
LOG: Returns the base 10 logarithm of a number.
MAX: Returns the highest number from a list of numbers.
MCEILING: Rounds a number up to the nearest integer, towards zero if negative.
MFLOOR: Rounds a number down to the nearest integer, away from zero if negative.
MIN: Returns the lowest number from a list of numbers.
MOD: Returns a remainder after a number is divided by a specified divisor.
ROUND: Returns the nearest number to a number you specify, constraining the new number by a specified number of digits.
SQRT: Returns the positive square root of a given number.
What does BEGINS do?
BEGINS Determines if text begins with specific characters and returns TRUE if it does. Returns FALSE if it doesn’t.
What does CASESAFEID do?
Converts a 15-character ID to a case-insensitive 18-character ID.
How would you use a default value formula to insert a different discount rate on an opportunity based on the department of the person creating the opportunity - (what might the formula look like)?
Use the following default value formula to insert a different discount rate on an opportunity based on the department of the person creating the opportunity:
CASE(User.Department, “IT”, 0.25, “Field”, 0.15, 0)
What returns the conversion rate to the corporate currency for the given currency ISO code?
CURRENCY RATE
If the currency is invalid, returns 1.0.
What is the description and use of the DISTANCE formula?
Description: Calculates the distance between two locations in miles or kilometers.
Use: DISTANCE(mylocation1, mylocation2, ‘unit’) and replace mylocation1 and mylocation2 with two location fields, or a location field and a value returned by the GEOLOCATION function.
Replace unit with mi (miles) or km (kilometers).
What is the only formula function that can use GEOLOCATION parameters?
DISTANCE is the only formula function that can use GEOLOCATION parameters.
What formula returns the position of a string within a string of text represented as a number? How can it be used?
FIND returns the position of a string within a string of text represented as a number.
FIND(search_text, text[, start_num]) and replace search_text with the string you want to find, replace text with the field or expression you want to search, and replace start_num with the number of the character from which to start searching from left to right.
Example: SUBSTITUTE(Email, LEFT(Email, FIND(“@”, Email)), “www.”) finds the location of the @ sign in a person’s email address to determine the length of text to replace with a “www.” as a means of deriving their website address.
The ________ function returns a location data type that can be used only by, and must be used with, the DISTANCE function.
The ________ function doesn’t work on its own.
The GEOLOCATION function returns a location data type that can be used only by, and must be used with, the DISTANCE function.
The GEOLOCATION function doesn’t work on its own.
What does the formula ABS do?
ABS
Description: Calculates the absolute value of a number. The absolute value of a number is the number without its positive or negative sign.
Use: ABS(number) and replace number with a merge field, expression, or other numeric value that has the sign you want removed.
Example: ABS(ExpectedRevenue) calculates the positive value of the Expected Revenue amount regardless of whether it’s positive or negative.
What returns an array of strings in the form of record IDs for the selected records in a list, such as a list view or related list?
GETRECORDIDS returns an array of strings in the form of record IDs for the selected records in a list, such as a list view or related list.
Use:{!GETRECORDIDS(object_type)} and replace object_type with a reference to the custom or standard object for the records you want to retrieve.
What two things can HTMLENCODE be used for in Salesforce?
HTMLENCODE
Tips: This function is only available in custom buttons and links, and in Visualforce.
Description: Encodes text and merge field values for use in HTML by replacing characters that are reserved in HTML, such as the greater-than sign (>), with HTML entity equivalents, such as >.
Use :{!HTMLENCODE(text)} and replace text with the merge field or text string that contains the reserved characters.
Example:If the merge field foo__c contains Enter the user’s name , {!HTMLENCODE(foo__c)} results in: Enter the user’s name
What is IMAGEPROXYURL used for?
Description: Securely retrieves external images and prevents unauthorized requests for user credentials.
Use: and replace http://exampledomain.com/pic.png with your image.
Example:
This IMAGEPROXYURL function retrieves and displays an image from Twitter’s image host, an external source. This function loads the Salesforce Twitter profile image over HTTPS. This function also prevents the image from making unauthorized requests for user credentials.
What is JSENCODE used for?
Description: Encodes text and merge field values for use in JavaScript by inserting escape characters, such as a backslash (), before unsafe JavaScript characters, such as the apostrophe (‘).
Use: {!JSENCODE(text)} and replace text with the merge field or text string that contains the unsafe JavaScript characters.
Example: If the merge field foo__c contains Enter the user’s name, {!JSENCODE(foo__c)} results in: \u003CB\u003EEnter the user's name\u003C\/b\u003E
What is LEFT used for?
LEFT
Description: Returns the specified number of characters from the beginning of a text string.
Use: LEFT(text, num_chars) and replace text with the field or expression you want returned; replace num_chars with the number of characters from the left you want returned.
Example:
TRIM(LEFT(LastName, 5)) & “-“ & TRIM(RIGHT(SSN__c, 4))
This formula displays the first five characters of a name and the last four characters of a social security number separated by a dash. Note that this example uses a text custom field called SSN.
Tips:
Reference auto-number fields as text fields in formulas.
If the num_chars value is less than zero, Salesforce replaces the value with zero.
What is LEN used for?
LEN
Description: Returns the number of characters in a specified text string.
Use: LEN(text) and replace text with the field or expression whose length you want returned.
Example:
LEN(PartNumber__c)
This formula returns the number of characters in a Product Code field.
What is LN used for?
LN
Description: Returns the natural logarithm of a specified number. Natural logarithms are based on the constant e value of 2.71828182845904.
Use: LN(number) and replace number with the field or expression for which you want the natural logarithm. Note: the LN function is the inverse of the EXP function.
Example:
LN(10) returns the natural logarithm of 10, which is 2.30.
LN(Value__c) returns the natural logarithm of a custom number field called Value.
What is LOWER used for?
LOWER
Description: Converts all letters in the specified text string to lowercase. Any characters that are not letters are unaffected by this function. Locale rules are applied if a locale is provided.
Use: LOWER(text, [locale]) and replace text with the field or text you wish to convert to lowercase, and locale with the optional two-character ISO language code or five-character locale code, if available.
Example:
MYCOMPANY.COM
LOWER(“MYCOMPANY.COM”) returns “mycompany.com.”
What are some examples for LPAD?
- Example:
-
Field Name: Padding
- LPAD(Name, 20) truncates the Name field after 20 characters. For example, if the name is mycompany.com, the value returned is “mycompany.com.
-
My_Company: No Change
- LPAD(‘my_company.com’, 14, ‘z’) returns “my_company.com” without change because it has 14 characters
-
Field Name Padded with Z
- LPAD(Name, 15, ‘z’) returns the name “zmycompany.com.
-
Field Name: Truncating
- LPAD(Name, 2) truncates the name after the second character. For example, if the name is mycompany.com, the value returned is “my.”
What is MCEILING used for?
MCEILING
Description: Rounds a number up to the nearest integer, towards zero if negative.
Use: MCEILING(number)
Example:
MCEILING(2.5) returns 3, which is 2.5 rounded up to the nearest integer.
MCEILING(-2.5) returns -2, which is -2.5 rounded up towards zero for a negative number.
What is MFLOOR used for?
Description: Rounds a number down to the nearest integer, away from zero if negative.
Use: MFLOOR(number)
Example:
MFLOOR(2.5) returns 2, which is 2.5 rounded down to the nearest integer.
MFLOOR(-2.5) returns -3, which is -2.5 rounded away from zero for a negative number.
What is MID used for?
Description: Returns the specified number of characters from the middle of a text string given the starting position.
Use: MID(text, start_num, num_chars) and replace text with the field or expression to use when returning characters; replace start_num with the number of characters from the left to use as a starting position; replace num_chars with the total number of characters to return.
Example: MID (Division, 3, 4) returns four characters of the Division name beginning with the third character from the left. On a user record, this represents the department code.
What is MOD used for?
Description: Returns a remainder after a number is divided by a specified divisor.
Use: MOD(number, divisor) and replace number with the field or expression you want divided; replace divisor with the number to use as the divisor.
Example:
MOD(3, 3) returns 0
MOD(4, 3) returns 1
MOD(123, 100) returns 23
You might want to prevent users from scheduling meetings on a Saturday or Sunday. Use the following example to apply a validation rule to a custom date field called My Date.
CASE(MOD(My_Date__c - DATE(1900, 1, 7), 7), 0, 0, 6, 0, 1) = 0
This example displays the following error message when the value of My Date is not Monday through Friday: “My Date is not a weekday.”
What is PARENTGROUPVAL?
PARENTGROUPVAL
Description: This function returns the value of a specified parent grouping. A “parent” grouping is any level above the one containing the formula. You can use this function only in custom summary formulas and at grouping levels for reports, but not at summary levels.
Use:
Summary and Joined: PARENTGROUPVAL(summary_field, grouping_level)
Matrix: PARENTGROUPVAL(summary_field, parent_row_grouping, parent_column_grouping)
Where summary_field is the summarized field value, grouping_level is GRAND_SUMMARY or the API name of the parent level group for summary reports, and parent_row_level and parent_column_level are the parent levels for matrix reports.
In reports with multiple grouping levels, you can set the grouping_level to be any group level higher than the formula display level.
Example:
TOTAL_PRICE:SUM/PARENTGROUPVAL(TOTAL_PRICE:SUM, GRAND_SUMMARY)
This formula calculates, for each product, its relative size compared to the grand total. In this example, the report is a summary of opportunities and their products, grouped by Product Name.
What is PREVGROUPVAL?
Description: This function returns the value of a specified previous grouping. A “previous” grouping is one that comes before the current grouping in the report. Choose the grouping level and increment. The increment is the number of columns or rows before the current summary. The default is 1; the maximum is 12. You can use this function only in custom summary formulas and at grouping levels for reports, but not at summary levels.
Use: PREVGROUPVAL(summary_field, grouping_level [, increment])
Where summary_field is the name of the grouped row or column, grouping_level is the API name of the peer level group whose summary value for the previous grouping is used, and increment is the number of groupings previous.
In reports with multiple grouping levels, you can specify the grouping_level to be the same group level as the formula display level or a group level higher than the formula display level.
Example:
AMOUNT:SUM - PREVGROUPVAL(AMOUNT:SUM, CLOSE_DATE)
This formula calculates, for each month, the difference in amount from the previous month shown in the report. In this example, the report is an opportunity matrix with columns grouped by Close Date and rows by Stage.
What is REGEX?
REGEX
Description: Compares a text field to a regular expression and returns TRUE if there is a match. Otherwise, it returns FALSE. A regular expression is a string used to describe a format of a string according to certain syntax rules.
Use: REGEX(text, regex_text) and replace text with the text field, and regex_text with the regular expression you want to match.
Validation Rule Example:
This example ensures that a custom field called SSN matches a regular expression representing a valid social security number format of the form 999-99-9999.
NOT( OR( LEN (SSN__c) = 0, REGEX(SSN__c, “[0-9]{3}-[0-9]{2}-[0-9]{4}”) ) )
What is URLENCODE?
Description: Encodes text and merge field values for use in URLs by replacing characters that are illegal in URLs, such as blank spaces, with the code that represent those characters as defined in RFC 3986, Uniform Resource Identifier (URI): Generic Syntax. For example, blank spaces are replaced with %20, and exclamation points are replaced with %21.
Use: {!URLENCODE(text)} and replace text with the merge field or text string that you want to encode.
Example: If the merge field foo__c contains Mark’s page, {!URLENCODE(foo_c)} results in: %3CB%3EMark%27s%20page%3C%2Fb%3E
Tips:
This function is only available in custom buttons and links, and in Visualforce.
True or False?
Dates and times are always calculated using the user’s time zone.
TRUE
Dates and times are always calculated using the user’s time zone.
What functions can picklist fields only be used in?
Picklist fields can only be used in these functions:
ISPICKVAL—Compares the value of a picklist to a single value.
CASE—Compares the value of a picklist to multiple values.
TEXT—Returns a picklist value’s API Name so that you can work with a reference to the value (even if the displayed value changes) in functions that support text values, such as CONTAINS. (Available in only flow formula resources, formula fields, validation rules, and workflow field updates.)
What functions can multi-select picklists only be used in?
Multi-select picklist fields can only be used in these functions:
INCLUDES
ISBLANK
ISNULL
ISCHANGED (Only in assignment rules, validation rules, workflow field updates, and workflow rules in which the evaluation criteria is set to Evaluate the rule when a record is: created, and every time it’s edited)
PRIORVALUE (Only in assignment rules, validation rules, workflow field updates, and workflow rules in which the evaluation criteria is set to Evaluate the rule when a record is: created, and every time it’s edited)
You want to reference record types in formulas for different workflow rules, validation rules, and lookup filters to apply to different record types. When possible, which one should you use:
RecordTypeId
OR
RecordType.Name?
When possible, use RecordTypeId instead of RecordType. Name to reference a specific record type. While RecordType.Name makes a formula more readable, you must update the formula if the name of the record type changes, whereas the ID of a record type never changes. Also, RecordType.Name requires a cross-object reference to the record type, while RecordTypeId doesn’t. However, if you are deploying formulas across organizations (for example, between sandbox and production), use RecordType.Name because IDs are not the same across organizations.
Avoid using $RecordType in formulas, except in default value formulas. Instead, use the RecordType merge field (for example, Account.RecordType.Name) or the RecordTypeId field on the object.
True or False?
You can’t include an object as the lookup field in a formula.
TRUE
You CANNOT include an object as the lookup field in a formula. To reference an object, reference the object’s ID field or another field on the object.
For example, Account.Owner is invalid because it references the object directly. Account.Owner.FirstName or Account.OwnerId are valid references for your formula.
What is a Cross-object formula?
A Cross-object formula is a formula that spans two related objects and references merge fields on those objects.
A cross-object formula can reference merge fields from a master (“parent”) object if an object is on the detail side of a master-detail relationship. A cross-object formula also works with lookup relationships.
You can reference fields from objects that are up to 10 relationships away. A cross-object formula is available anywhere formulas are used except when creating default values.
True or False?
If you create a formula that references a field on another object and display that formula in your page layout, users can see the field on the object even if they don’t have access to that object record.
TRUE
If you create a formula that references a field on another object and display that formula in your page layout, users can see the field on the object even if they don’t have access to that object record.
For example, if you create a formula field on the Case object that references an account field, and display that formula field in the case page layout, users can see this field even if they don’t have access to the account record.
True or False?
You can use the Power of One on any object.
TRUE
You can use the Power of One on any object.
For example, if you had a report with 10 accounts, each with three opportunities, your Opportunities report returns 30 records. Adding the Power of One formula field to Account allows you to see the number of distinct accounts represented in the records. Some pros say they add a Power of One field to every object in their org!
Why might a missing parenthesis occur in an error?
This error most often occurs when the number of opening parentheses doesn’t match the number of closing parentheses. It can be particularly difficult to avoid this error if you’re using several functions at once. Try breaking your function into multiple lines so it’s easier to tell which sets of parentheses belong together.
You’ll also see this error if you forget a comma between two function parameters. This error is confusing because the actual problem doesn’t match up with the syntax checker. If you’re certain your parentheses are correct, double check that the commas in your function are correct as well.
What does Incorrect Parameter mean for an error in a formula?
Incorrect parameter type: If you give a function a number parameter when it expects text (or any other combination of data types), this is the error you see.
Always check the help text or the documentation so you know what kind of parameters a function accepts.
What does the ‘Incorrect number of parameters for function’ error mean?
If you input too many or too few parameters into a function, the syntax checker alerts you. Again, check the help text or documentation for guidelines on inputting parameters to specific functions.
Why might you see the ‘Field does not exist’ when writing a formula?
Field does not exist: This error indicates that you’ve included a field in your formula that your object doesn’t support. In this case, check your spelling and capitalization. If you can’t find any mistakes, try inserting the field from the Insert Field menu again to make sure you’re referencing it correctly.
Another reason you see this error is if you forget to put quotation marks around a text literal or a hyperlink.
How would you write a checkbox formula that determines whether a particular opportunity is a “big” opportunity. It should check whether the number of employees at the opportunity account’s associated company is greater than 1,000 AND whether the opportunity amount is greater than $10,000. If both statements are true, the field appears as a checked box on the Opportunity page layout. Otherwise, it appears as a blank box.
True or False?
Salesforce recalculates the value of campaign roll-up summary fields when leads or contacts are deleted.
FALSE
Salesforce does not recalculate the value of campaign roll-up summary fields when leads or contacts are deleted. Select the Force a mass recalculation of this field option on the edit page of the roll-up summary field to manually recalculate the value.
What can’t you use in roll-up summary filters?
You can’t use:
- long text area
- multi-select picklist
- Description fields
- system fields like Last Activity
- cross-object formula fields
- and lookup fields. . .
in the field column of roll-up summary filters.
True or False?
After you have created a roll-up summary field on an object, you cannot convert the object’s master-detail relationship into a lookup relationship.
TRUE
After you have created a roll-up summary field on an object, you CANNOT convert the object’s master-detail relationship into a lookup relationship.
True or False?
Roll-up summary fields are not available for mapping lead fields of converted leads.
TRUE
Roll-up summary fields are not available for mapping lead fields of converted leads.
True or False?
If a roll-up summary field doesn’t contain cross-object field references or functions that derive values on the fly, such as NOW or TODAY, it can calculate the values of formula fields.
TRUE
If a roll-up summary field doesn’t contain cross-object field references or functions that derive values on the fly, such as NOW or TODAY, it CAN calculate the values of formula fields.
A roll-up summary field can trigger workflow rules and field validations. However, workflow rules and field validations do not fire when any of what 6 changes cause a mass recalculation of roll-up summary values?
- Changing the roll-up summary definition (such as the object, function, or field being aggregated)
- Changing the expression of a formula field referenced in a roll-up summary field
- Replacing picklist values for picklist fields referenced in the roll-up summary filter
- Changing picklist record type definitions
- Changing currency conversion rates
- Changing price book entries
Calculating roll-up summary field values can take up to how long, depending on the number of records affected and other factors?
Calculating roll-up summary field values can take up to 30 minutes, depending on the number of records affected and other factors.
True or False?
If your organization uses multiple currencies, the currency of the master record determines the currency of the roll-up summary field.
TRUE
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.
True or False?
If your organization has advanced currency management enabled, currency roll-up summary fields are invalid if they are on accounts and summarizing opportunity values, or on opportunities and summarizing custom object values.
TRUE
If your organization has advanced currency management enabled, currency roll-up summary fields are invalid if they are on accounts and summarizing opportunity values, or on opportunities and summarizing custom object values.
True or False?
Salesforce prevents users from saving a record if it invalidates a related record.
TRUE
Salesforce prevents users from saving a record if it invalidates a related record.
For example, a master record has a validation rule that requires the roll-up summary field value to be greater than 100. If the user’s change to a related child record would put the value over 100, the user can’t save the record.
True or False?
Once created, you can change the detail object selected or delete any field referenced in your roll-up summary definition.
FALSE
Once created, you cannot change the detail object selected or delete any field referenced in your roll-up summary definition.
When you refer to a roll-up summary field in a list view or report, you can’t use certain qualifiers, including what?
- Starts with
- Contains
- Does not contain
- Includes
- Excludes
- Within
Each custom object can have up to how many master-detail relationships?
Each custom object can have up to two master-detail relationships and many lookup relationships. Each relationship is included in the maximum number of custom fields allowed.
TRUE OR FALSE?
You can convert a master-detail relationship to a lookup relationship as long as no roll-up summary fields exist on the master object.
TRUE
Master-Detail to Lookup = no roll-up fields
You can convert a master-detail relationship to a lookup relationship as long as no roll-up summary fields exist on the master object.
Converting a master-detail relationship to a lookup for a custom object on the “detail” side, changes the organization-wide default for the object to _______.
Converting a master-detail relationship to a lookup for a custom object on the “detail” side, changes the organization-wide default for the object to public read/write.
True or False?
You cannot convert a lookup relationship to a master-detail relationship if the lookup field in all the records contains a value.
FALSE
Lookup to Master-Detail = lookup field contains a value
You CAN convert a lookup relationship to a master-detail relationship if the lookup field in all the records contains a value.
Converting a lookup to a master-detail-relationship changes the organization-wide default to Controlled by Parent and the sharing model is updated to ____________.
Converting a lookup to a master-detail-relationship changes the organization-wide default to Controlled by Parent and the sharing model is updated to public read/write.
You can create a relationship from an object to itself, but it must be a ______ relationship.
You can create a relationship from an object to itself, but it must be a lookup relationship.
True or False?
A single record can’t be linked to itself.
TRUE
You can create a relationship from an object to itself, but it must be a lookup relationship, and a single record can’t be linked to itself. However, a record can indirectly relate to itself. For example, the Holiday Promotion campaign can have the Direct Mail campaign selected in the lookup relationship, and the Direct Mail campaign can have the Holiday Promotion campaign selected in the lookup relationship.
True or False?
The two master-detail relationships on a junction object can’t have the same master object.
TRUE
You can’t create a many-to-many self-relationship, that is, the two master-detail relationships on the junction object CANNOT have the same master object.
As a best practice, don’t exceed ____child records for a master-detail relationship.
As a best practice, don’t exceed 10,000 child records for a master-detail relationship.
Many-to-many relationships provide two standard report types that join the master objects and the junction object. The report types are what?
“Primary master with junction object and secondary master” in the primary master object’s report category.
“Secondary master with junction object and primary master” in the secondary master object’s report category.
To create multilevel master-detail relationships, you need the _____ _____ user permission.
To create multilevel master-detail relationships, you need the “Customize Application” user permission.
True or False?
By default, records can’t be reparented in master-detail relationships.
TRUE
By default, records CANNOT be reparented in master-detail relationships.
Administrators can, however, allow child records in master-detail relationships on custom objects to be reparented to different parent records by selecting the Allow reparenting option in the master-detail relationship definition.
In Master-Detail relationships, you can have up to _____ custom detail levels.
You can have up to three custom detail levels.
True or False?
Standard objects can be on the detail side of a custom object in a master-detail relationship.
FALSE
Standard objects CANNOT be on the detail side of a custom object in a master-detail relationship.
You can use multilevel master-detail relationships in custom report types. The ____ ____ checkbox must be checked when you create the custom object.
You can use multilevel master-detail relationships in custom report types. The Allow Reports checkbox must be checked when you create the custom object.
Custom report types created for multilevel master-detail relationships count towards the organizations custom report type limit and no reports are generated if this limit is exceeded.
TRUE OR FALSE?
Custom junction objects can’t have detail objects.
TRUE
Custom junction objects can’t have detail objects. That is, a custom junction object can’t become the master object in a multilevel master-detail relationship.
True or False?
You can’t delete a custom object if it is on the master side of a master-detail relationship.
TRUE
You can’t delete a custom object if it is on the master side of a master-detail relationship. If you delete a custom object that is on the detail side of a master-detail relationship, the relationship is converted to a lookup relationship.
True or False?
If you delete a detail record and later, separately, delete its master record, you cannot undelete the detail record.
TRUE
If you delete a detail record and later, separately, delete its master record, you cannot undelete the detail record, as it no longer has a master record to relate to.
What is a broken permission dependency?
A profile or a permission set can have an entity, such as Account, with a master-detail relationship. A broken permission dependency exists if the child entity has permissions that the parent should have. Salesforce updates the parent entity for a broken permission dependency on the first save action for the profile or permission set.
What happens to a junction object if both associated master records are deleted?
Junction object records are deleted when either associated master record is deleted and placed in the Recycle Bin. If both associated master records are deleted, the junction object record is deleted permanently and can’t be restored.
True or False?
Sharing access to a junction object record is determined by a user’s sharing access to both associated master records and the Sharing Setting option on the relationship field.
TRUE
Sharing access to a junction object record is determined by a user’s sharing access to both associated master records and the Sharing Setting option on the relationship field.
For example, if the sharing setting on both parents is Read/Write, then the user must have Read/Write access to both parents in order to have Read/Write access to the junction object. If the sharing setting on both masters is Read-Only, a user with Read-Only rights on the master records would have Read access to the junction object.
In a many-to-many relationship, a user can’t delete a parent record if there are more than ____ junction object records associated with it and if the junction object has a roll-up summary field that rolls up to the other parent.
In a many-to-many relationship, a user can’t delete a parent record if there are more than 200 junction object records associated with it and if the junction object has a roll-up summary field that rolls up to the other parent.
To delete this object, manually delete junction object records until the count is fewer than 200.
The first master-detail relationship you create on your junction object becomes the _____ relationship.
The first master-detail relationship you create on your junction object becomes the primary relationship.
The first master-detail relationship you create on your junction object becomes the primary relationship. How does this affect the look and feel of the junction object records?
The junction object’s detail and edit pages use the color and any associated icon of the primary master object.
The first master-detail relationship you create on your junction object becomes the primary relationship. How does this affect the record ownership of the junction object records?
Record ownership: The junction object records inherit the value of the Owner field from their associated primary master record.
Because objects on the detail side of a relationship do not have a visible Owner field, this is only relevant if you later delete both master-detail relationships on your junction object.
The first master-detail relationship you create on your junction object becomes the primary relationship. How does this affect the divisions of the junction object records?
Division: If your organization uses divisions to segment data, the junction object records inherit their division from their associated primary master record. Similar to the record ownership, this is only relevant if you later delete both master-detail relationships.
For a junction object, if you delete the primary master-detail relationship or convert it to a lookup relationship, what happens to the secondary master object?
If you delete the primary master-detail relationship or convert it to a lookup relationship, the secondary master object becomes primary.
True or False?
You can define Apex triggers on master objects but not on the junction object.
FALSE
You can define Apex triggers on both master objects and the junction object.
True or False?
A junction object can’t be on the master side of another master-detail relationship.
TRUE
A junction object can’t be on the master side of another master-detail relationship.
If the lookup field is optional, you can specify one of three behaviors to occur if the lookup record is deleted. What are they?
If the lookup field is optional, you can specify one of three behaviors to occur if the lookup record is deleted:
-
Clear the value of this field
- This is the default. Clearing the field is a good choice when the field doesn’t have to contain a value from the associated lookup record.
-
Don’t allow deletion of the lookup record that’s part of a lookup relationship
- If you have dependencies built on the lookup relationship, such as a workflow rule, this option doesn’t allow the lookup record to be deleted.
-
Delete this record also
- Available only if a custom object contains the lookup relationship, not if it’s contained by a standard object.
- However, the lookup object can be either standard or custom. Choose when the lookup field and its associated record are tightly coupled and you want to completely delete related data.
True or False?
With lookup relationships choosing ‘Delete this record also’ can result in a cascade-delete.
TRUE
Choosing Delete this record also can result in a cascade-delete.
A cascade-delete bypasses security and sharing settings, which means users can delete records when the target lookup record is deleted even if they don’t have access to the records. To prevent records from being accidentally deleted, cascade-delete is disabled by default. Contact Salesforce to get the cascade-delete option enabled for your organization.
What isn’t cascade delete available for when it comes to lookup relationships?
Cascade-delete and its related options aren’t available for lookup relationships to:
- business hours
- network
- lead
- price book
- product,
- user objects.
Only _____, ___ ____, and ___ ____ relationships are available for external objects. No other relationship types are supported.
Only lookup, external lookup, and indirect lookup relationships are available for external objects. No other relationship types are supported.
True or False?
Depending on the availability of the external system, related lists of child external objects can load slowly when users view the parent record detail pages.
TRUE
Depending on the availability of the external system, related lists of child external objects can load slowly when users view the parent record detail pages.
True or False?
Relationships that involve external objects allow users to create child records from the record detail pages of parent record and the relationship field on each new child record is automatically populated to identify the parent record.
FALSE
Relationships that involve external objects allow users to create child records from the record detail pages of parent records. However, the relationship field on each new child record IS NOT automatically populated to identify the parent record.
True or False
With external objects, you can’t change the field type of a sync-created custom field to Lookup Relationship, External Lookup Relationship, or Indirect Lookup Relationship.
FALSE
Syncing doesn’t create relationship fields on the external objects in your Salesforce org. However, you can change the field type of a sync-created custom field to Lookup Relationship, External Lookup Relationship, or Indirect Lookup Relationship. Changing the field type of an existing custom field is simpler and more efficient than manually creating a relationship field on the external object.
An external system has a foreign key relationship. Syncing the related tables creates a text field in your org for the external column that identifies the foreign keys. What can you do to best reflect the foreign keyrelationship?
To reflect the foreign key relationship within your org, change the field type of that text field to External Lookup Relationship.
True or False?
Cascade-delete isn’t available for external object relationships.
TRUE
Cascade-delete isn’t available for external object relationships.
True or False
Lookup search isn’t available for external lookup relationship fields.
TRUE
Lookup search isn’t available for external lookup relationship fields. To edit an external lookup relationship field, manually enter the value of the External ID standard field for the parent record. This limitation doesn’t apply when the parent external object is associated with the cross-org adapter for Salesforce Connect.
With external lookup and indirect lookup relationships, how does the parent record appear?
With external lookup and indirect lookup relationships, the parent record appears as a clickable link in the relationship field on the child record. If the child record is viewed by a user who doesn’t have access to the parent record, the parent record appears in the relationship field as plain text instead of a link.
True or False?
Lookup filters aren’t available for external lookup relationship fields.
TRUE
Lookup filters aren’t available for external lookup relationship fields.
True or False?
Indirect lookup relationship fields can be created on external objects only.
TRUE
Indirect lookup relationship fields can be created on external objects only.
Only objects that have a custom field with the ____ ____ and ____ attributes are available as parent objects in indirect lookup relationships.
Only objects that have a custom field with the External ID and Unique attributes are available as parent objects in indirect lookup relationships.
If you don’t see the desired object when you create an indirect lookup relationship field, add a custom unique, external ID field to that object.
TRUE or FALSE?
Converting a relationship from lookup to master-detail or vice versa can cause existing custom reports to become unusable.
TRUE
Converting a relationship from lookup to master-detail or vice versa can cause existing custom reports to become unusable due to the different standard report types available for each type of relationship. We recommend that you test your custom reports immediately after converting the relationship type. If you revert your relationship back to the original type, the reports are restored and become usable again.
With reports, when specifying filter criteria on roll-up summary fields, what logic does ‘does not contain’ use for comma-separated values?
When specifying filter criteria on roll-up summary fields, does not contain uses “or” logic on comma-separated values.
On list views, reports, and dashboards, does not contain uses ___ logic.
On list views, reports, and dashboards, does not contain uses “and” logic.
For what filter can you use ‘Between’
Available for dashboard filters only. Use to filter on ranges of values. For each range, the filter returns results that are greater than or equal to the minimum value and less than the maximum value.
For example, if you enter “Number of Employees from 100 through 500,” your results include accounts with 100 employees up to those with 499 employees. Accounts with 500 employees aren’t included in the results.
For what type of custom field can ‘within’ criteria be used?
Available when you create list views based on a Geolocation custom field. Shows results that are within the specified radius from a fixed latitude and longitude. For example, if you enter “Warehouse location within 50 miles 37.775° –122.418°,”, your list view includes all warehouses within a 50–mile radius of San Francisco, California.
True or False?
Records can’t be reparented in a master-detail relationship.
TRUE
By default, records can’t be reparented in master-detail relationships.
Administrators can, however, allow child records in master-detail relationships on custom objects to be reparented to different parent records by selecting the Allow reparenting option in the master-detail relationship definition.
True or False?
Custom objects on the detail side of a master-detail relationship can’t have sharing rules, manual sharing, or queues.
TRUE
Custom objects on the detail side of a master-detail relationship can’t have sharing rules, manual sharing, or queues, as these require the Owner field.
True or False?
In the detail record of a master-detail relationship, you can set permissions on the detail record independently of the master.
FALSE
Detail and subdetail records inherit security settings and permissions from the master record. You can’t set permissions on the detail record independently.
True or False?
The master-detail relationship field is not required on the page layout of the detail and subdetail records.
FALSE
The master-detail relationship field (which is the field linking the objects) is required on the page layout of the detail and subdetail records.
Each custom object can have up to two master-detail relationships and up to __ total relationships.
Each custom object can have up to two master-detail relationships and up to 25 total relationships.
True or False?
The Related To entry can be changed after you save the relationship in a master-detail relationship.
FALSE
The Related To entry can’t be changed after you save the relationship.
True or False?
Lookup relationships are similar to master-detail relationships, except they don’t support sharing or roll-up summary fields.
TRUE
Lookup relationships are similar to master-detail relationships, except they don’t support sharing or roll-up summary fields.
True or False?
You can link an object with itself.
TRUE
Link an object with itself (except for the user object; see Hierarchical). For example, you might want to link a custom object called Bug with itself to show how two different bugs are related to the same problem.
True or False?
Lookup relationships from objects related to the campaign member object aren’t supported.
TRUE
Lookup relationships from objects related to the campaign member object aren’t supported; however, you can create lookup relationships from the campaign member object related to other objects.
What is a hierarchical relationship?
A special lookup relationship available for only the user object. It lets users use a lookup field to associate one user with another that does not directly or indirectly refer to itself. For example, you can create a custom hierarchical relationship field to store each user’s direct manager.
How would you write a validation rule to validates that a custom date field contains a date within the current year?
Formula: YEAR( My_Date__c ) <> YEAR ( TODAY() )
Error Message: Date must be in the current year.
Error Location: My Date
Write a validation rule to determine if the difference between two values (Salary Max and Salary Min) is greater than $20,000. A value of “True” indicates that the data entered by the user contains an invalid value. That is, if the user enters two values whose difference exceeds the $20,000 salary range, the validation rule returns a response of “True” and sends an error message.
Description: Validates that the range between two custom fields, Salary Min and Salary Max, is no greater than $20,000.
Formula:
(Salary_Max__c - Salary_Min__c) > 20000
Error Message: Salary range must be within $20,000. Adjust the Salary Max or Salary Min values.
Error Location: Salary Max
Write a validation rule so that if the user enters a website URL with an extension that is not equal to (is either greater than or less than) all six of the valid extensions (.com, .COM, .ORG, .org, .NET, .net), the validation rule returns a response of “True” and sends an error message. If the user enters a website URL with an extension that is identical to (is not greater than or less than) one of the valid extensions, the validation rule returns a response of “False” and does not send an error message, because the data the user entered is valid.
Description: Validates a custom field called Web Site to ensure that its last four characters are in an explicit set of valid website extensions.
AND(
RIGHT( Web_Site__c, 4) <> “.COM”,
RIGHT( Web_Site__c, 4) <> “.com”,
RIGHT( Web_Site__c, 4) <> “.ORG”,
RIGHT( Web_Site__c, 4) <> “.org”,
RIGHT( Web_Site__c, 4) <> “.NET”,
RIGHT( Web_Site__c, 4) <> “.net” )
Error Message: Web Site must have an extension of .com, .org, or .net .
Error Location: Web Site
Validate that the account Billing Country is a valid ISO 3166 two-letter code.
OR(
LEN(BillingCountry) = 1,
NOT(
CONTAINS(
“AF:AX:AL:DZ:AS:AD:AO:AI:AQ:AG:AR:AM:” &
“AW:AU:AZ:BS:BH:BD:BB:BY:BE:BZ:BJ:BM:BT:BO:” &
“BA:BW:BV:BR:IO:BN:BG:BF:BI:KH:CM:CA:CV:KY:” &
“CF:TD:CL:CN:CX:CC:CO:KM:CG:CD:CK:CR:CI:HR:” &
“CU:CY:CZ:DK:DJ:DM:DO:EC:EG:SV:GQ:ER:EE:ET:FK:” &
“FO:FJ:FI:FR:GF:PF:TF:GA:GM:GE:DE:GH:GI:GR:GL:” &
“GD:GP:GU:GT:GG:GN:GW:GY:HT:HM:VA:HN:HK:HU:” &
“IS:IN:ID:IR:IQ:IE:IM:IL:IT:JM:JP:JE:JO:KZ:KE:KI:” &
“KP:KR:KW:KG:LA:LV:LB:LS:LR:LY:LI:LT:LU:MO:MK:” &
“MG:MW:MY:MV:ML:MT:MH:MQ:MR:MU:YT:MX:FM:MD:MC:” &
“MC:MN:ME:MS:MA:MZ:MM:MA:NR:NP:NL:AN:NC:NZ:NI:” &
“NE:NG:NU:NF:MP:NO:OM:PK:PW:PS:PA:PG:PY:PE:PH:” &
“PN:PL:PT:PR:QA:RE:RO:RU:RW:SH:KN:LC:PM:VC:WS:” &
“SM:ST:SA:SN:RS:SC:SL:SG:SK:SI:SB:SO:ZA:GS:ES:” &
“LK:SD:SR:SJ:SZ:SE:CH:SY:TW:TJ:TZ:TH:TL:TG:TK:” &
“TO:TT:TN:TR:TM:TC:TV:UG:UA:AE:GB:US:UM:UY:UZ:” &
“VU:VE:VN:VG:VI:WF:EH:YE:ZM:ZW”,
BillingCountry)))
True or False?
Validation rules don’t apply if you create records for an object with Quick Create.
TRUE
Validation rules don’t apply if you create records for an object with Quick Create.
TRUE OR FALSE?
The detail page of a custom activity field does not list associated validation rules.
TRUE
The detail page of a custom activity field does not list associated validation rules. To edit the validation rule for a custom activity field, select the validation rule from Setup by entering Activities in the Quick Find box, then selecting Activities and choose Task Validation Rules or Event Validation Rules.
Use the ______ merge field in your formula to apply different validations for different record types.
Use the RecordType.Id merge field in your formula to apply different validations for different record types.
True or False?
You have to begin a validation rule formula with the IF function.
FALSE
You don’t have to begin a validation rule formula with the IF function. Any Boolean error condition expression works. For example:
Correct: CloseDate < TODAY()
Incorrect: IF(CloseDate < TODAY(), TRUE, FALSE)
True or False?
When a validation rule contains the BEGINS or CONTAINS function, it processes blank fields as valid.
TRUE
When a validation rule contains the BEGINS or CONTAINS function, it processes blank fields as valid. For example, if you have a validation rule that tests whether the serial number of an asset begins with “3”, all assets with a blank serial number are considered valid.
When using a validation rule to ensure that a number field contains a specific value, use the _____function to include fields that don’t contain any value.
When using a validation rule to ensure that a number field contains a specific value, use the ISBLANK function to include fields that don’t contain any value.
For example, to validate that a custom field contains a value of ‘1’, use the following validation rule to display an error if the field is blank or any other number:
OR (ISBLANK (field__c), field__c<>1)
True or False?
Use the IsClosed or IsWon opportunity merge fields in validation formulas to determine if the Stage contains the appropriate value.
FALSE
Avoid using the IsClosed or IsWon opportunity merge fields in validation formulas. Instead, use the ISPICKVAL function to determine if the Stage contains the appropriate value. For example, the following validation formula makes a custom Project Start Date field required whenever the Stage is “Closed Won”:
What type of field can you use to simplify your validation rules?
Simplify your validation formulas by using checkbox fields, which don’t require any operator because they return true or false. For example, the following validation formula checks to be sure an opportunity has opportunity products using the HasOpportunityLineItem merge field before users can save a change to it:
NOT(OR(ISNEW(),HasOpportunityLineItem))
True or False?
You cannot translate error messages in validation rules.
FALSE
If you have a multilingual organization, translate your error messages. You can translate error messages using the Translation Workbench.
In what order does Salesforce process rules?
Val assigns auto work easily
Salesforce processes rules in the following order:
- Validation rules
- Assignment rules
- Auto-response rules
- Workflow rules (with immediate actions)
- Escalation rules
True or False?
When one validation rule fails, Salesforce continues to check other validation rules on that field or other fields n the page and displays all error messages at once.
TRUE
When one validation rule fails, Salesforce continues to check other validation rules on that field or other fields n the page and displays all error messages at once.
What happens if a validation rule exists for an activity and you create an activity during lead conversion?
If validation rules exist for activities and you create an activity during lead conversion, the lead converts but a task isn’t created.
What do you need to do to ensure validation rules get enforced during lead conversion?
Validation rules are only enforced during lead conversion if validation and triggers for lead conversion are enabled in your organization.
True or False?
Campaign hierarchies ignore validation rules.
TRUE
Campaign hierarchies ignore validation rules.
True or False?
Salesforce runs validation rules before it creates records submitted via Web-to-Lead and Web-to-Case and then creates records that have valid values.
TRUE
Salesforce runs validation rules before it creates records submitted via Web-to-Lead and Web-to-Case and then creates records that have valid values.
True or False?
Validation rules do not run on individual records if the owner is changed.
FALSE
Validation rules continue to run on individual records if the owner is changed.
True or False?
If the Mass Transfer tool is used to change the ownership of multiple records, validation rules run on those records.
FALSE
If the Mass Transfer tool is used to change the ownership of multiple records, validation rules don’t run on those records.
What can’t or don’t validation rule formulas refer to?
Validation rule formulas don’t or can’t refer to:
-
Compound fields, including addresses, first and last names, and dependent picklists and lookups
- NOTE However, you can use compound fields in ISNULL, ISBLANK, and ISCHANGED functions.
- Campaign statistic fields, including statistics for individual campaigns and campaign hierarchies
-
Merge fields for auto-number or compound address fields, such as Mailing Address
- NOTE You can use merge fields for individual address fields, such as Billing City, in validation rule formulas.
True or False?
You can use roll-up summary fields in validation rules because the fields don’t display on edit pages.
TRUE
You can use roll-up summary fields in validation rules because the fields don’t display on edit pages.
True or False?
Do not use roll-up summary fields as the error location.
TRUE
Do not use roll-up summary fields as the error location.
When should you use a lookup filter vs. a validation rule?
Validation rules and lookup filters achieve similar ends, but offer different advantages.
Use a lookup filter:
- To improve user efficiency by limiting the number of available options in a lookup search dialog.
- To improve user efficiency by automating filters on lookup search dialogs that your users manually set.
Use a validation rule:
- If you’re close to the maximum number of lookup filters allowed.
- To implement a complex business rule that requires you to use a formula. Formulas can reference fields that basic filter criteria can’t reference, such as fields on the parent of the source object. Formulas can also use functions. For example, use ISNEW to apply the rule only on record creation, or ISCHANGED to apply the rule only when a field changes.
What happens to the location of a validation error if a field is deleted, is read only, or isn’t visible on the page layout?
When defining validation rules, you can set the error location to Top of Page or Field. If the error location is set to a field that is later deleted, to a field that is read only, or to a field that isn’t visible on the page layout, Salesforce automatically changes the location to Top of Page.
What are the two parts of a picklist?
Field and Value Set
What are the 3 types of a picklist and what properties can picklists have?
We have three types of picklists:
- Standard
- Custom
- Custom Multi-Select
And picklist fields can have the following properties:
- Restricted
- Dependent or Controlling
What are the 3 ways picklists can be defined?
Values can be defined three ways:
- Set individual values when you create the picklist. These are specific to a single picklist field.
- Use the built-in set of values for the standard picklist fields that come with your Salesforce org.
- Create a global value set. A global value set is a custom set of values you create to share with more than one picklist field.
What can’t you do with a standard picklist?
- Delete it from your org
- Use a Formula for a Default Value
- Select Multiple Values
- Make it Restricted
- Make it a Dependent Picklist
What types of custom field picklists can you create?
- Local picklist—Lets users select a single value from a list that you define. This picklist is unique and had its own set of values.
- Shared picklist—Lets users select a single value from a global picklist value set that you define in Setup. All custom picklist fields that use a global value set inherit its values and can’t have additional values.
- Multi-select picklist—Allows users to select more than one picklist value from a list that you define. These fields display each value separated by a semicolon.