We’ve compiled a list of over 75+ common Salesforce interview questions companies are likely to ask candidates. And not only that, we provide sample answers to help you prepare. Whether you’re a Salesforce rookie just getting started or a seasoned pro, this guide will help build your confidence so you can ace your Salesforce interview.

1. What is Salesforce?

Salesforce is a customer relationship management (CRM) platform that allows businesses to organize and manage customer data and interactions. Some of its key products are:

2. What are the benefits of Salesforce?

Some major benefits of Salesforce include:

3. What are the core Salesforce products?

The core products in the Salesforce ecosystem are:

salesforce service cloud course

4. What are the different types of relationships in Salesforce?

There are many relationship types in Salesforce, including:

5. Explain the Salesforce sharing model.

The sharing model in Salesforce controls who sees what. It’s made up of:

6. What are the different types of custom fields in Salesforce?

The main custom field types in Salesforce include:

7. What is an object in Salesforce?

Objects are the building blocks of Salesforce. They represent your data and help organize it into logical entities. Some examples are:

8. What is a record in Salesforce?

A record is an individual entry in a Salesforce object. For example, a single account like “Acme Inc” would be a record in the Account object. Records contain fields like name, address, industry, etc. depending on the object.

9. What is a Salesforce profile?

Profiles determine what data and features each user has access to. Admins can customize profiles to match the responsibilities of different job functions in your company. Profiles are a key part of Salesforce security.

10. What is a Salesforce role hierarchy?

The role hierarchy organizes users and profiles into a hierarchy that can be used for sharing and reporting purposes. For example, you might have roles for Account Executives, Sales Managers, and Sales VPs. Users inherit permissions from roles above them in the hierarchy.

11. What is a Salesforce dashboard?

Dashboards provide an easy way to view and monitor key metrics and data in one place. They contain visual components like charts, tables, metrics, and more. Dashboards can give you insight into the health and performance of your Salesforce data.

12. What are Governor Limits in Salesforce?

Governor Limits are constraints enforced by Salesforce to ensure optimal performance and scalability of the platform. They limit the number of API calls, query rows, DML statements, and other resource-intensive operations. As an admin, you need to understand these limits and how to optimize your org to avoid hitting them. Some options include:

13. Explain Sharing Rules and their Precedence

Sharing rules determine who can access records in Salesforce. They follow a strict order of precedence from most restrictive to least restrictive. The sequence is:

  1. Private
  2. Public Groups and Sharing Groups
  3. Owner and Managers
  4. Roles
  5. Territories
  6. Account
  7. Organization-Wide Defaults

It’s critical to understand this order when setting up your security model to avoid unwanted record access.

14. What is a Junction Object?

A junction object is used to create a many-to-many relationship between two object records in Salesforce. For example, if you wanted to relate Opportunities to Accounts and Contacts (who are also related), you could create a custom junction “Opportunity Contact Role” object with a master-detail relationship to both the Opportunity and Contact objects. This allows a single opportunity to have multiple related contacts and a single contact to have multiple related opportunities.

15. Describe your experience with Salesforce APIs

Salesforce provides several APIs to allow interaction with your organization’s data programmatically. I have experience with:

Built integrations using these APIs to connect Salesforce with ERP and marketing automation systems. I am also familiar with tools like Postman, Workbench, and MuleSoft for developing on the Salesforce platform.

16. What is a validation rule?

A validation rule ensures data entered meets certain standards before it’s saved. As an Admin, you’ll create validation rules to enforce data quality. For example, a rule could check:

To create a validation rule, go to Setup, enter Validation Rules in the Quick Find box, and then click New Rule. Select the object you want to validate, build your rule logic with a formula, error message, and rule name, and then activate the rule. Data that doesn’t meet the rule criteria won’t save.

17. What are page layouts and how do you modify them?

Page layouts control what fields and related lists display for users on record detail pages in Salesforce. As an Admin, you’ll customize page layouts to match how your users work. For example, you might:

18. What are the different environments in Salesforce?

Salesforce has three environments – Production, Sandbox, and Developer Edition.

19. What are the different editions of Salesforce?

The major Salesforce editions are:

20. What is an object?

An object refers to a Salesforce object – any object that can be stored in the Force.com platform database. This includes:

sObjects have fields that store information and contain data. They also have relationships with other subjects.

21. What are Record Types?

Record Types are a classification for records that allow users to predetermine page layouts, picklists, and business processes associated with records. Some main uses of Record Types are:

Record Types are a key part of Salesforce data management and automation.

22. What are the main steps to deploy Salesforce applications?

The main steps to deploy apps in Salesforce are:

  1. Develop the app in a sandbox org
  2. Create a package.xml file that defines the components in your app
  3. Upload the app to the package in your sandbox
  4. Install the app in your production org

23. What is the difference between static and dynamic dashboards?

Static dashboards contain data that remains the same and is not updated. The data is static, or fixed in time. Dynamic dashboards, on the other hand, automatically refresh the data to show you the latest information.

With a dynamic dashboard, you’ll be viewing real-time data that’s always up to date. As soon as information in the system changes, the dashboard changes. This enables you to spot important trends as they happen and make quick data-driven decisions.

24. What is the difference between Force.com and Salesforce.com?

Force.com is Salesforce’s platform as a service (PaaS) offering. On the other hand, Salesforce.com is the company that offers the Force.com platform along with other cloud services. Force.com allows you to build and run custom apps. With Force.com you don’t have to worry about the infrastructure required to keep them up and running. It provides all the tools you need to create custom business logic, workflows, and user interfaces.  so you can build robust apps for your organization.

salesforce learning programs

25. What is the difference between Triggers and Workflow?

Triggers and Workflow are two of the most commonly used tools for automation in Salesforce. While they seem quite similar on the surface, there are some key differences to understand.

Triggers:

Triggers are event-driven programs that fire whenever a record is inserted, updated, or deleted. They allow you to perform custom actions before or after changes are made to records in Salesforce. For example, you might have a trigger on the Account object that sends an email alert whenever an account is created. Triggers can also update related records and validate data before it’s saved.

Workflows:

Workflows are process automations that are triggered by field updates on a record. They allow you to automate standard actions like email alerts, field updates, and task creations. For example, you might have a workflow on the Opportunity object that sends a notification to the sales manager whenever an opportunity stage is changed to “Closed Won”. Unlike triggers, workflows cannot access or update related records. They are limited to acting on the single record that triggered the workflow.

26. What can cause data loss in Salesforce?

Data loss is a serious concern in Salesforce. There are a few ways it can happen:

User Error:

Accidental deletion of records or fields by users is a common cause of data loss. Salesforce allows admins to set field-level security and sharing rules to limit who can edit and delete data, but human error can still occur. Always double-check before deleting records or fields!

Integration Issues:

If you have integrations set up between Salesforce and other systems. errors in the integration logic or mappings can lead to data loss. For example:  if a field is mapped incorrectly, data may be overwritten or deleted during the integration process. Thoroughly test any integrations before deploying them in production.

Platform Bugs:

Even Salesforce itself is not immune to bugs that can cause data loss. Though rare, some platform issues have led to data corruption or deletion in the past. To protect yourself, enable daily exports of your data in case you need to re-import if data loss occurs. You should also report any serious platform bugs to Salesforce support immediately.

Data Recovery:

The good news is Salesforce provides tools to help recover data if loss occurs. You can use the weekly export service to retrieve a backup of your data from up to 60 days in the past. The Data Loader can also be used to re-import deleted records. And if platform issues caused the data loss, Salesforce may be able to recover data from their backups.

27. How can you edit apex classes in a production environment?

To edit Apex classes in a production Salesforce org, you’ll need to deploy code through a sandbox org first. Salesforce prevents direct edits to Apex code in production to ensure stable, high-performing deployments.

Use a Developer Edition Org:

Sign up for a free Developer Edition org. This provides you with a separate Salesforce environment to develop and test code. You can deploy code from here directly to your production org.

Make Code Changes in the Developer Org:

Log into your Developer Edition org and navigate to the Apex class you want to edit. Make your changes and save the class.

Deploy to Production:

Navigate to the Deploy | Deployments page. Click “Deploy” to start a new deployment. Select the components you want to deploy, including the Apex class(es) you edited. Choose “Deploy to Production” and click “Deploy.”

Check Deployment Status:

The deployment process can take a few minutes. You’ll receive an email confirmation once complete. To check the status at any time, go to Deploy | Deployment Detail. Ensure it shows as “Succeeded” before the code is live in your production org.

28. What are Permission sets?

Permission sets allow you to grant access to specific objects and fields to a group of users. They provide more granular control over user access than profiles alone.

29. When to Use Permission Sets

You would use permission sets when:

30. What do you understand about the term fiscal year or economic year in Salesforce?

The fiscal year in Salesforce refers to the 12-month period that a company uses for accounting and reporting purposes. Many companies’ fiscal years run from January 1 to December 31, while others may run from April 1 to March 31, or October 1 to September 30.

In Salesforce, you can define your company’s fiscal year so that reports, forecasts, and analytics align to your specific business cycles. When you set up Salesforce, you specify the start and end dates of your fiscal year. Then, all reporting features will use that fiscal year by default.

31. What is Salesforce Lightning?

Salesforce Lightning is Salesforce’s new user experience. It includes a redesigned interface, with a mobile-first responsive design. Lightning improves on the traditional Salesforce interface in several ways:

Easier to navigate:

The Lightning interface is more intuitive and streamlined. It’s built with a modern UI framework, making it easier to find what you need. Common tasks have been simplified, and related items are grouped logically.

Faster and more responsive:

Lightning was built with speed and mobility in mind. The interface is fast, fluid, and responsive, optimized for any screen size. This means you can be productive on any device – desktop, tablet, or phone.

More productivity features:

Lightning includes lots of built-in tools to boost your productivity. Things like Kanban boards for task management, embedded notifications, and a global search bar to quickly find any data or function.

32. What is an Audit trail?

An audit trail tracks key details about changes made to an object in Salesforce. It captures information like:

33. What is a wrapper class?

A wrapper class is a class that wraps an existing class and extends its functionality. It encapsulates the underlying class and adds additional features to it. In Salesforce, wrapper classes are commonly used to extend the functionality of standard Salesforce objects like Accounts, Contacts, Opportunities, etc. For example, say you want to add a custom field and logic to the standard Account object. You’d create a wrapper class called “MyAccount” that extends the Account object. The MyAccount class would contain the custom field and logic, but under the hood, it’s still based on the Account object.

34. What does a Custom Object permit the user to do?

A Custom Object allows you to create your own type of record in Salesforce with custom fields to track information that’s specific to your organization. Say you want to store details about your company’s products, clients, or assets—you can build Custom Objects to handle all the data for those records.

Once you’ve created your Custom Object, you get to decide what fields it will have. Add text, number, date, checkbox, and lookup fields to capture all the details you need. You can even relate Custom Objects to each other with lookup or master-detail relationships, like connecting products to suppliers or clients.

With Custom Objects, the possibilities are endless. You have the flexibility to tailor Salesforce to fit your business needs exactly. Whether you’re storing data about opportunities, cases, projects, or anything else, Custom Objects allows you to keep all that information in one place—your Salesforce org.

salesforce service cloud

35. What is Self Relationship in Salesforce?

A self-relationship in Salesforce is when an object has a lookup relationship to itself. This allows you to link records of the same object together in a parent-child relationship.

For example, say you have an Account object and you want to model a parent-child hierarchy between accounts. You would create a self-relationship field on the Account object that looks up to other Account records. This establishes the hierarchical link between parent and child accounts.

Some common uses of self-relationships are:

36. Is there a limit for data.com records?

Yes, there is a limit to the number of records you can have on Data.com. The current limits are:

To increase your limit, you will need to upgrade to a higher Data.com edition. 

37. What are some things that you can do to prevent governor limits?

To prevent hitting governor limits in Salesforce, there are a few things you can do:

Disable debug logs:

Debug logs track a lot of information to help troubleshoot issues, but they take up a lot of resources. Disabling debug logs will free up some capacity and help avoid governor limits.

Delete test data:

Old test data that is no longer needed takes up storage space and impacts performance. Regularly deleting unused test data will reduce strain on the system.

Reduce SOQL queries:

SOQL queries that return large amounts of data can easily hit query limits. Try rewriting queries to be more specific and selective in the data returned. You can also use limits in SOQL to cap the number of records returned.

Minimize DML statements:

Performing too many DML statements (INSERT, UPDATE, DELETE) at once can hit governor limits. Break up large batches of DML statements into smaller chunks to avoid this.

Review code for inefficiencies:

Inefficient Apex code, SOQL queries, or workflow/validation rules can impact performance and governor limits. Review your organization’s code for any areas that can be made more efficient. Small optimizations can go a long way.

Monitor usage regularly:

The best way to avoid governor limits is to regularly monitor your organization’s usage and performance. Watch things like heap size, query limits, DML statements, and debug log usage. Take action as usage approaches critical levels to prevent hitting limits. Monitoring usage should be an ongoing process.

38. How does Salesforce track sales?

Salesforce has powerful tools to help companies track sales activity and measure key performance indicators.

Opportunity Management:

Salesforce organizes potential sales into “opportunities.” Each opportunity represents a deal in progress and tracks details like the account, key contacts, products, pricing, and the opportunity stage (e.g. prospecting, qualifying, closing). Sales reps log calls, emails, tasks, events, and updates against each opportunity to maintain a complete record of the sales process.

Managers can view opportunity metrics like the opportunity pipeline, win/loss rate, sales cycle length, and opportunity age to identify areas for improvement. They can also spot trends, like products or services that close deals faster.

Reporting and Dashboards:

Salesforce offers real-time reports and dashboards for an instant view of key sales numbers. Standard reports include sales leaderboards, opportunity reports, and sales forecasts. The drag-and-drop dashboard builder lets you create custom dashboards with reports, metrics, charts, and key performance indicators of your choice.

With Salesforce reporting, sales managers always have visibility into sales performance, can uncover insights to optimize the sales process, and make data-driven decisions to improve sales productivity and growth.

Forecasting:

The opportunity forecasting features help companies predict sales revenue and set quotas. Reps can enter an estimated close date, deal value, and probability of closing for each opportunity. Salesforce aggregates this data to provide sales forecasts at the opportunity, account, product, and company levels. Managers can then adjust forecasts as needed based on sales performance and market changes.

39. What is a static resource in Salesforce?

A static resource is an object that can contain static files, such as images, JavaScript, and CSS files. Static resources allow you to upload and serve static content that can be used in your Salesforce org.

Some common uses of static resources include:

40. What are the different types of reports available in Salesforce?

There are several types of reports you can create in Salesforce to gain insights into your data.

Tabular Reports:

The most common type, tabular reports display your data in a table with rows and columns. They’re great for listing records, summarizing information, and filtering/sorting data.

Summary Reports:

Provide high-level overviews by aggregating records into groups. They calculate sums, averages, and maximum and minimum values for numeric fields. Useful for dashboards and KPI monitoring.

Matrix Reports:

Show the relationship between two groups of records as an interactive pivot table. For instance, you can see opportunities by account and stage, or cases by product and status. Allow you to drag and drop columns to reorganize the view.

Joined Reports:

Combine data from multiple standard/custom objects into a single report. For example, include opportunity and account information in one report to show deals by customer details. Require lookup relationships between objects.

Dashboard Component Reports:

Specifically designed as components on dashboards. Usually narrow in scope, focusing on a single metric, chart, or table. Provide a quick visual snapshot of key data.

Custom Report Types:

Bundle custom fields, formulas, and filters together for a customized reporting experience. Control the layout, available fields, and filters for users. Useful when you want to create purpose-built reports for your team or customers.

With the variety of reports available in Salesforce, you have full visibility into your data and can gain actionable insights to optimize your business processes. Spend time exploring the options to determine what types of reports will be most useful for your needs.

41 . How to create Static Resources 

To create a static resource:

  1. Go to Setup, enter “Static Resources” in the Quick Find box, then select Static Resources.
  2. Click New to create a new static resource.
  3. Enter a name, description, and content type for your resource. The content type will depend on the type of file you’re uploading, such as image/jpeg for an image or text/css for a CSS file.
  4. Click Choose File to select the file from your local machine.
  5. Click Save to upload the file.

Your static resource will now appear in the list of resources and can be referenced in Visualforce pages, used as custom logos/stylesheets, or included in Lightning components. Using static resources is a great way to customize your Salesforce org and enhance the user experience. Let me know if you have any other questions!

42. Can two users have the same profile? Can two profiles be assigned to the same user?

Two users cannot have the same profile, but a single user can have multiple profiles assigned to them.

Profiles are unique to each user:

Profiles in Salesforce are meant to determine a user’s access level and permissions. Because of this, each profile is unique to a specific user. Two users cannot share a single profile. However, a manager may have a ‘Manager’ profile while also having a separate ‘VP of Sales’ profile to access higher-level data and permissions.

One user, multiple profiles:

It is common for users to have more than one profile assigned to them in Salesforce. For example, a user may need an ‘Employee’ profile for their day-to-day work but also need a ‘Recruiter’ profile temporarily to help out in that department. Assigning multiple profiles to a single user allows them to easily switch between different levels of access as needed for their various responsibilities.

43. What is a sandbox org? What are the different types of sandboxes in Salesforce?

A sandbox org is a separate copy of your production org for testing and development purposes. There are a few types of sandboxes in Salesforce:

Developer Sandbox:

A developer sandbox is a private space for each developer to build and test applications. Changes made in a developer sandbox do not affect your production org or other sandboxes. This sandbox is ideal when you want to build and test functionality without impacting live data or users.

Partial copy sandbox:

A partial copy sandbox contains a subset of your production org’s data, metadata, and configurations. You can refresh a partial copy sandbox on demand to bring in updates from your production org. This type of sandbox is good for testing changes that involve sensitive data or configurations.

Full sandbox:

A full sandbox is an exact copy of your production org. It includes all your data, metadata, configurations, and customizations. You can use a full sandbox to test major changes before deploying them to your live org or to provide user acceptance testing. Changes made in a full sandbox do not impact your production org.

Developer Pro sandbox:

The Developer Pro sandbox is a more powerful version of the Developer sandbox, with additional compute, memory, and storage resources. This sandbox type is ideal for more complex development and testing use cases.

44. Can you edit an apex trigger/ apex class in the production environment?

No, you cannot directly edit Apex triggers or Apex classes in a production Salesforce environment. However, there are a few ways to update code in production:

Deploying via Change Sets or the Metadata API

The recommended way to update Apex code in production is by deploying the updates from your sandbox or developer environment using either Change Sets or the Metadata API.

Using these methods ensures proper version control and testing before the updated code is pushed to production.

Using the ANT Migration Tool:

The ANT Migration tool is a Java/XML-based build tool that can be used to retrieve, deploy, delete, and update components in an org. You write ANT scripts to deploy changes between environments. Again, proper testing should be done before deploying to production.

Pushing Changes via Force.com IDE:

You can use the Force.com IDE to make changes to the Apex code and push those changes directly to production. However, this method does not provide any version control or a way to properly test the updates before deploying to production, so should only be used in emergency cases. It is not a best practice and not recommended.

salesforce developer professional

45. Can you edit a Visualforce page in a production environment?

Yes, you can edit a Visualforce page in a production Salesforce environment. However, there are a few things to keep in mind:

Testing First:

Before editing a Visualforce page in production, thoroughly test your changes in a sandbox or developer environment. Double-check that the edited page still functions as intended and does not cause any issues.

Deploy Changes with Care:

When you are ready to deploy the edited Visualforce page to production, do so cautiously. It’s best to deploy changes during non-peak hours when user activity is lower. This minimizes the risk of disrupting active users or critical business processes. You should also consider notifying users that changes are being made, in case they experience any temporary issues accessing the page.

Version Control:

Maintain version control of your Visualforce pages by using the built-in versioning tools in Salesforce. Before editing a page in production, save the current version so you have a backup to revert to if needed. When you save an edited version, include detailed notes on exactly what changes were made. This makes it easy to track differences between versions and rollback if necessary.

Limited Access:

Restrict access to editing Visualforce pages in production to only authorized administrators and developers. This helps ensure any changes made have been properly tested and the implications fully considered before deploying to a live environment accessed by end users.

46. Why are Visualforce pages served from a different domain?

Visualforce pages are served from a different domain for security reasons.

When you access a Visualforce page, the URL will be in the format:

https://yourInstance.visual.force.com/apex/yourPageName

Instead of your usual Salesforce domain. This is because Visualforce pages can contain Apex code, and for security, Salesforce does not allow the execution of Apex code on their primary domain.

The Visualforce domain is a sandboxed domain, meaning any Apex code on pages in that domain cannot access data or call APIs on other domains. This helps prevent malicious code from compromising your main Salesforce org.

Visualforce pages can access your Salesforce data and call the Salesforce API only because Salesforce “trusts” the Visualforce domain and has granted it access. But code on the Visualforce domain cannot access other domains like google.com or your company’s internal network.

47. What are the different types of email templates that can be created in Salesforce?

There are a few types of email templates you can create in Salesforce:

Standard Email Template:

The standard email template is a basic template used to send generic emails. You can add text, images, and hyperlinks to these templates.

Visualforce Email Template:

Visualforce email templates allow you to create dynamic, data-driven emails using Visualforce. You have more flexibility and control over the content and layout. These are ideal for sending personalized, targeted emails.

Letterhead Email Template:

Letterhead email templates allow you to add an image header to the top of your emails to make them look more professional. You can upload your company logo or letterhead design.

Newsletter Email Template:

Newsletter email templates are designed specifically for sending newsletters and marketing emails. They provide pre-built layouts to showcase images, highlights, and calls to action. You can customize the colors, fonts, and content to match your brand.

Transactional Email Template:

Transactional email templates are used to send automatic emails triggered by events in Salesforce, such as welcome emails, order confirmations, or login alerts. The content is dynamically generated using Visualforce to include record details.

48. What is a bucket field in reports?

A bucket field in Salesforce reports allows you to group report records together by a specific field value. This can help provide summary information and insights into your data.

For example, say you want to see the number of opportunities won and lost by month. You would set the bucket field to ‘Close Date’ and the report would show:

Rather than having to count the opportunities manually, the bucket groups them for you. 

49. What are dynamic dashboards? Can dynamic dashboards be scheduled?

Dynamic dashboards are interactive dashboards that display real-time data from Salesforce. They utilize filters, charts, metrics, and other components that automatically refresh as your data changes.

Can dynamic dashboards be scheduled?

Yes, dynamic dashboards can be scheduled to run on a recurring basis. This allows you to automate the dashboard refresh process. You can schedule a dynamic dashboard to run daily, weekly, or monthly at a specific time.

When a scheduled dashboard run executes, Salesforce will refresh the dashboard with the latest data. 

50. Can you have a roll-up summary field in case of a Master-Detail relationship?

Yes, you can have roll-up summary fields in Master-Detail relationships. A roll-up summary field calculates values from related records in a Master-Detail relationship.

For example, say you have an Opportunity as the master record and related Opportunity Products as the detail records. You can create a roll-up summary field on the Opportunity like Total Price that sums the Unit Price from the related Opportunity Products.

51. How to set up a roll-up summary field:

  1. Make sure you have a Master-Detail relationship established between the objects you want to roll up values from.
  2. Go to the master object and create a new field. Select “Roll Up Summary Field” as the data type.
  3. Choose the detail object you want to roll up values from.
  4. Select the field on the detail object that contains the values you want to calculate. For example, choose Unit Price.
  5. Choose the calculation you want to perform, such as Sum.
  6. The roll-up summary field will now automatically calculate the sum of the related detail object’s Unit Price field and display the total on each master record.
  7. Any new detail records you add will be included in the calculation.
  8. If detail records are deleted, the calculation is updated.
  9. You can roll up fields of type Number, Currency, and Percent.

Roll-up summary fields are a powerful way to summarize and display information from a Master-Detail relationship on one record. Let me know if you have any other questions!

52. Explain the term “Data Skew” in Salesforce.

Data skew refers to the uneven distribution of data across Salesforce instances. For example, a large amount of data may be concentrated in one or a few instances, while other instances have little data in comparison. This can cause performance and scalability issues.

53. What are some Common causes of data skew in Salesforce include?

Uneven data distribution:

Data is not distributed evenly across instances due to flawed logic in the data distribution process. For example, accounts may be distributed based on account name, causing accounts starting with A-M to be on one instance and N-Z on another.

Imbalanced object relationships:

Parent-child object relationships are where the parent object is evenly distributed but the child object is concentrated on a few instances. For example, accounts are evenly spread but opportunities are concentrated on a couple of instances.

Application design issues:

The application is designed in a way that causes data skew, e.g. using a custom index on a field that ends up grouping lots of data together on an instance.

To fix data skew, you need to rebalance your data by redistributing it evenly across instances. You may also need to redesign your application to prevent skew in the future. Monitoring for data skew and fixing it proactively is key for Salesforce performance and scalability.

54. How to create self-relationships in salesforce. 

To create a self-relationship in Salesforce, you define a lookup relationship field on an object that looks up to the same object. For example:

  1. Go to the object you want to add a self-relationship to, like Account.
  2. Click ‘New’ next to the Custom Fields & Relationships related list.
  3. Select ‘Lookup Relationship’ as the data type.
  4. For the Related To field, choose the same object, like Account.
  5. Label the field something like ‘Parent Account’.
  6. Choose if you want the relationship to be required or not.
  7. Click Save.

Your self-relationship field will now appear on the page layout and records can be linked together in a parent-child hierarchy. Pretty powerful stuff! With a little configuration, self-relationships open up a lot of possibilities in Salesforce.

55. Are there any workaround options you can try before upgrading higher Data.com edition

Clean your existing records:

Go through your existing records and clean up any duplicates or outdated information. Remove or archive records you no longer need. This can free up space under your current limit.

Use record types judiciously:

Only enable the record types you need. Having fewer record types active means fewer fields to populate per record, so you can store more records within your limit.

Minimize custom fields

Custom fields take up extra space, so only build the custom fields that are absolutely necessary. The more custom fields you have, the fewer records you can have.

Archive old records

If you have records that are outdated or no longer actively used, archive them. Archived records still count towards your storage limit but can be unarchived if needed in the future. This helps declutter your active records and frees up space.

salesforce developer

56. What are some key points about bucket fields?

58. Which fields are automatically Indexed in Salesforce?

When you’re dealing with Salesforce, there are certain fields that are automatically indexed to make your life easier.

Standard Fields:

Standard fields like Name, Owner, CreatedDate, and LastModifiedDate are indexed by default. This means you can quickly search and sort records using these fields.

Custom Fields:

For custom fields, Salesforce automatically indexes fields of type text, text area, rich text area, email, phone, URL, and picklist. So if you create a custom picklist or text field, you’ll be able to search and filter on those values right away.

Lookup Fields:

Lookup fields are also indexed, allowing you to search for records that are linked to a particular parent record. This comes in handy when you want to find all opportunities associated with a particular account, for example.

59. What are the types of custom settings in Salesforce?

There are two main types of custom settings in Salesforce:

List Custom Settings:

List custom settings allow you to create a list of records to store configuration data. For example, you can create a list of possible product types, account ratings, or lead scores. List custom settings are a great way to provide picklist values that can be reused across your org.

Hierarchy Custom Settings:

Hierarchy custom settings are like little custom objects that you can use to store configuration data in a hierarchical relationship. For example, you may want to store data related to your company’s organizational chart, geographical locations, or product categories in a hierarchical structure. Hierarchy custom settings provide a user interface to view and manage this kind of data.

60. What are the differences between List Custom Settings and Hierarchy Custom Settings?

61. What is the advantage of using custom settings in Salesforce?

Custom settings in Salesforce allow you to store and retrieve custom data at the organization, profile, and user levels. They provide more flexibility than custom fields alone.

Some key benefits of using custom settings are:

62. What is the difference between a Role and a Profile in Salesforce?

A Role defines a set of permissions in Salesforce, like what a user can see and do. A Profile applies a Role to a user, so the user inherits all the permissions defined in the Role.

The key differences are:

Using Roles and Profiles together in Salesforce allows you to efficiently manage permissions at scale. Roles do the heavy lifting to define major permission sets, then Profiles apply those permissions to users with any custom tweaks needed. This system means you don’t have to manually configure permissions for every single user, but you still have the flexibility to meet specific needs.

63. What are the different ways of deployment in Salesforce?

There are a few ways to deploy Salesforce applications:

Change Sets:

Change Sets are a point-and-click deployment tool in the Salesforce Setup menu. They allow you to package and deploy customizations between Salesforce organizations.

Salesforce DX (Developer Experience):

Salesforce DX is a set of tools and features that facilitate a more modern development workflow. It includes a command-line interface (CLI) and allows for source-driven development.

Ant Migration Tool:

The Ant Migration Tool is a set of Java and Ant tasks for moving metadata between a local directory and a Salesforce organization.

Metadata API:

The Metadata API is a web service that allows developers to retrieve, deploy, create, update, or delete customizations for Salesforce organizations.

Salesforce CLI (Command-Line Interface):

The Salesforce CLI is a powerful command-line interface that provides a modern development experience. It supports various commands for development, deployment, and management tasks.

64. What is an external ID in Salesforce?

An external ID is a custom field that can be used as a unique identifier in Salesforce. It contains values from an external system. External IDs are used to prevent duplicate records from being created in Salesforce.

65. When to Use an External ID

You should use an external ID when:

66. Defining an External ID

To define an external ID in Salesforce, follow these steps:

  1. Go to the object (like Account or Contact) where you want to add the external ID.
  2. Click Fields & Relationships.
  3. Click New to add a new custom field.
  4. Select External ID as the data type.
  5. Enter an API Name and Label for the external ID field.
  6. Make sure Store this value in Salesforce is checked.
  7. Click Save.

67. Which field data types can be used as external IDs?

Some of the most common field types that can be used as external IDs in Salesforce are:

These are simple types that can uniquely identify a record.

A formula field can combine multiple fields to create a unique ID. For example, you can combine Account Name and Billing City to create an external ID.

Auto number fields automatically generate a unique sequential number for each record. This acts as a foolproof external ID.

The developer name is a unique name given to a custom object in Salesforce. It stays constant even if the object name is changed, so it’s suitable for an external ID.

diploma in salesforce

68. How many callouts to external service can be made in a single Apex transaction?

In Apex, you can make a maximum of 100 callouts to external services within a single transaction.

69. Why is there a limit?

Salesforce enforces limits on callouts to ensure:

If you exceed the 100 callout limit within a transaction, you’ll receive a “Too many callouts” exception and your transaction will be rolled back. 

70. How to avoid this?

Staying within the callout limits will ensure fast, stable performance in your Salesforce org. Let me know if you have any other questions!

71. How can you expose an Apex class as a REST WebService in Salesforce?

To expose an Apex class as a REST WebService in Salesforce, follow these steps:

1. Define the class as global:

Make sure the class has the global access modifier. REST WebServices can only be created from global Apex classes.

2. Annotate the class with @RestResource:

This annotation marks the class as available for REST requests. You need to specify the URL mapping for the resource, for example:

@RestResource(urlMapping=’/Account/*’)

3. Define endpoints:

Create public static methods in the Apex class and annotate them with @HttpGet, @HttpPost, @HttpPut, or @HttpDelete to expose GET, POST, PUT, and DELETE endpoints respectively. For example:

@HttpGet

public static Account get account() {…}

4. Handle requests and return responses:

The Apex methods will handle the REST requests and return appropriate responses which can be:

5. Test your code:

Use Postman or a similar tool to send REST API requests to your WebService endpoints and verify the responses.

72. What is the difference between a standard controller and a custom controller?

A standard controller is a default controller provided by Salesforce. It contains the standard logic required for a specific standard object. A custom controller is a controller that you create to provide custom logic for a page.

Differences

73. How can we implement pagination in Visualforce?

Pagination in Visualforce allows you to split large amounts of data into separate pages to improve user experience.

To enable pagination, you need to:

74. What are the three types of bindings used in Visualforce? What does each refer to?

The three types of bindings in Visualforce are:

These bindings connect your Visualforce markup to the logic in your Apex controllers and allow components on the page to interact with each other and modify data. Component and controller work hand in hand to provide a seamless user experience. Understanding the types of bindings and how to properly use them is key to building powerful Visualforce pages.

75. What are the different types of collections in Apex?

Apex collections allow you to store multiple values of the same type together. There are three main types of collections in Apex:

Lists:

Lists are ordered collections of elements of the same type. You can access elements using their index, and lists allow duplicate values.

Sets:

Sets are unordered collections of unique elements. You cannot access elements by index, and sets do not allow duplicate values.

Maps:

Maps are collections of key-value pairs where each key maps to a single value. Keys and values can be of any data type. Maps do not have a defined order, and keys must be unique.

In addition to these, Apex also has Enumsets (sets with enumerated values) and Enummaps (maps with enumerated keys). Collections allow you to efficiently store, access, and manipulate data in your Apex code.

76. What are maps in Apex?

Maps are Apex data structures used to store key-value pairs. They’re useful for caching data and providing fast lookups.

Some common uses of maps include:

Conclusion:

With these sample questions, you’ll be ready to handle whatever questions come your way. Remember, do your research, highlight your relevant experience, provide thoughtful answers, and show your enthusiasm for the work. If you go in with a positive attitude, you’ll be well on your way to landing that Salesforce role. Best of luck and crush that interview! The new job and exciting career in Salesforce Development are within your reach.