Fields – Salesforce interview questions

Go through the list of Salesforce interview questions based on custom fields created for custom/standard object.

What are the fields refer to?

Objects referred to database tables, whereas fields referred to columns of the columns of the table.

What are standard fields? Mention some of the standard field names.

Whenever the object is created, set of fields are created automatically. These fields cannot be deleted or cannot be changed to have another datatype (Except Name Field).

  • Created By
  • Modified By
  • Owner

What are the types of custom fields?

Fields can have following types

  • Text
  • Auto Number
  • Formula
  • Picklist
  • Multiselect Picklist
  • Date
  • Date/Time
  • Time
  • Email
  • Currency
  • Checkbox
  • Number
  • Percent
  • Phone
  • URL
  • Text Area
  • Long Text Area
  • Rich Text Area
  • Encrypted Text
  • Geo location
  • Lookup Relationship
  • External Lookup
  • Master Detail Relationship

Which fields are indexed by default?

ID, Name, Owner, Lookup Fields, Master Detail Fields and Last Modified Dates

Which fields cannot be added as custom index?

Formula fields cannot be marked for custom index

What is the difference between Lookup and Master detail relationship?

Master Detail Relationship

  • Detail record cannot be created without a master (Tightly Coupled)
  • The number of master-detail relationships you can use are 2.
  • Roll up field can be created
  • If master record deleted, child record also gets deleted.
  • Sharing rules of master record are also applied to child

Lookup relationship

  • Detail record can be created without master (Loosely Coupled).
  • Maximum number of lookup fields are 25.
  • Rollup-summary field cannot be created in this relationship.
  • If master record deleted, child record is not deleted

What all functions present under Rullup summary fields?

Count, Min, Max or Sum

Can we convert lookup relationship to master detail relationship?

Only if all the existing records are linked to parent record. (Lookup field should not be blank)

Can we create master detail record for the object which has records?

As per the definition, master detail record should have parent linked to it. For existing records, this definition will get violated and Salesforce will show error message. To do this, first you need to create lookup relationship, using data loader or any other tool, you need to populate the lookup field and then convert lookup to master detail.

What is an external id?

External ID refers to ID from external system. Suppose Salesforce system have an integration with Net Suite system and a same account is also present in Net Suite side, to refer this account with Salesforce account, a text field is created by marking it as External ID and populating ID from Net Suite to this field. External ID fields are also becomes searchable in Sidebar.

Is it possible to update record without specifying id of record?

Yes, fields marked as external ids are used to update or insert (Upsert) records without specifying the record id. Syntax is upsert Accounts NetSuite_Id__c

What is an Unique ID?

It allows unique value across all records of object on which it’s created. It can either be case sensitive or insensitive.

What are the limitations of single picklist field

Up to 1,000 values
Up to 255 characters per value

What are the limitations of multi select picklist field

  • Up to 500 values
  • Up to 255 characters per value
  • Users can select up to 100 values at a time on a record.

Is it possible to edit Roll up summary field value in a record?

No. roll up summary fields are read only fields and they can not be edited.

What happens to child record when a master record is deleted in Look-up Relationship?

Child records are not affected when the parent got deleted.

What is field dependency? What data type can be used as controlling fields?

When the options of second field (Dependent) depends upon value selection in first field (Controlling), it’s called field dependency. E.g. On select of country value, related states from that country should be shown.

  • Picklist
  • checkbox

Standard picklist cannot be dependent picklist. Custom fields can be controlling as well as dependent fields.

What are encrypted fields? how to convert to

A field defined as encrypted is not visible to users. Typical usage of encrypted field is for password. Only users with “View Encrypted Data” can view the encrypted fields. Encrypted fields are editable.
Encrypted fields can not be used in where clause in SOQL. To check encrypted fields, Goto Setup > Security Control > Platform Security > Encryption Policy > Encrypt Fields

Which all masking types are available for encrypted text?

  • Mask All Characters
  • Last 4 Characters Clear
  • Credit Card Number
  • National Insurance Number
  • Social Security Number
  • Social Insurance Number

Can we set any character for masking?

No, we can set only two types of characters:

  • *
  • X

What is the maximum character length a long text area can have?

Upto 131,072 characters

What is external lookup relationship?

External Lookup Relationships are used to link parent external objects to child standard, custom, and external objects. This feature is useful if the data to be linked come from a database source outside of Salesforce. This relationship type can work together with Page Layouts to help you display linked data within and outside of Salesforce onto a single page.

Can we get deleted fields and its data?

Yes, salesforce stores the deleted objects and fields for 15 days in recycle bin. You can restore or un-delete them from recycle bin.

Which all fields cannot be used in roll up summary formulas?

  1. Long text area
  2. Multi-select picklist
  3. Description fields
  4. System fields like Last Activity
  5. Cross-object formula fields
  6. Lookup fields
  7. Auto number

What will happen if we undelete junction object and normal object from recycle bin?

Master – Detail Relationship data types will be converted to look up relationship data types.
If we undelete any object from recycle bin, then all master detail relationship will be changed to lookup relationship.

What are the available return types of formula fields?

  1. Checkbox (Boolean)
  2. Currency
  3. Date
  4. Date/Time
  5. Number
  6. Percent
  7. Text
  8. Time

What is the use of GETSESSIONID function in formula?

It returns the current session ID. This may be useful in hyperlinks to other applications that use credentials for authentication .

List down some of the limitations or considerations you faced while building formula fields

  1. Character limit – Formula fields can contain up to 3,900 characters, including spaces, return characters, and comments. If your formula needs more characters, create separate formula fields and reference them in another formula field.
  2. Save size limit – Formula fields can’t exceed 4,000 bytes when saved. The save size is different from the number of characters if you use multi-byte characters in your formula.
  3. Compile size limit – Formula fields can’t exceed 5,000 bytes when compiled. The compile size is the size of the formula (in bytes) including all of the fields, values, and formulas it references. There is no direct correlation between the compile size and the character limit. Some functions, such as TEXT, DATEVALUE, DATETIMEVALUE, and DATE significantly increase the compile size.
  4. Text area, encrypted, or Description fields cannot be used in formula.