Capgemini
10+ V Trust Eye Hospital Interview Questions and Answers
Q1. Write a trigger on Order Products. It should display the most number of sold product type on the account. Eg: if most order products sold out of Tv, Ac and Fridge is Tv then update Tv as the most_sold_product o...
read moreCreate a trigger on Order Products to display the most sold product type on the account
Create a trigger on Order Products object in Salesforce
Use SOQL query to count the number of each product type sold
Update the most_sold_product field on the Account object with the highest sold product type
Q2. Write a trigger on Account. if one or more contact is associated with Account then show error if user tries to delete the account
Create a trigger on Account to prevent deletion if associated with one or more contacts
Create an after delete trigger on Account object
Query for related contacts using SOQL
If contacts are found, add an error message to prevent deletion
Q3. What are best practices in Trigger? And what are trigger events?
Best practices in Trigger and trigger events
Best practices include bulkifying triggers, using helper classes, and limiting logic in triggers
Trigger events are before insert, before update, after insert, after update, etc.
Examples of trigger events include before insert, after update, etc.
Q4. What is connected App, remote site settings and OAuth?
Connected App, remote site settings, and OAuth are key components in Salesforce for enabling secure external access to Salesforce data and functionality.
Connected App is a framework that enables external applications to securely integrate with Salesforce using APIs.
Remote Site Settings allow Salesforce to make callouts to external services over HTTPS.
OAuth is an open standard for access delegation, commonly used in Salesforce for authentication and authorization of external a...read more
Q5. What type of parameters can be passed to Future?
Future methods in Salesforce can accept primitive data types as parameters.
Primitive data types like Integer, String, Boolean, etc. can be passed as parameters to Future methods.
Non-primitive data types like custom objects or collections cannot be passed as parameters to Future methods.
Example: @future public static void myFutureMethod(Integer param1, String param2) { }
Q6. Write a trigger on contact to display the number of contact on Account.
Create a trigger on Contact to display the number of contacts on the related Account.
Create an after insert, update, delete trigger on Contact object
Query for the count of contacts related to the Account
Update a custom field on the Account with the count of contacts
Q7. Write lwc code for displaying Accounts with related contacts in a list
Display Accounts with related contacts in a list using LWC code
Create a Lightning web component (LWC) to display the list
Use Apex to query for Accounts and their related Contacts
Iterate over the data to display Accounts and their related Contacts in the list
Q8. What are the decorators in Lwc and its uses?
Q9. How connection is done from Mulesoft to Salesforce
Connection from Mulesoft to Salesforce is done using Salesforce Connector in Mulesoft Anypoint Platform.
Use Salesforce Connector in Mulesoft Anypoint Platform to establish connection
Authenticate using Salesforce credentials (username, password, security token)
Utilize Salesforce APIs to interact with Salesforce data
Q10. What is with and without sharing?
With and without sharing in Salesforce determines whether sharing rules are enforced for a class.
With sharing keyword enforces sharing rules, restricting access to records based on the user's profile and organization-wide defaults.
Without sharing keyword does not enforce sharing rules, allowing full access to all records regardless of the user's profile or organization-wide defaults.
Q11. How to pass subjects to future methods?
To pass subjects to future methods, use the @future annotation in Apex.
Use the @future annotation before the method declaration to indicate that the method will run asynchronously in the future.
Pass the subject parameters to the @future method as arguments when calling the method.
Ensure that the subject parameters are serializable to be passed to future methods.
Q12. What are the tools for deployment?
Tools for deployment include Salesforce DX, Ant Migration Tool, Change Sets, and Metadata API.
Salesforce DX is a command-line interface for development and deployment
Ant Migration Tool is a Java/Ant-based tool for moving metadata between environments
Change Sets allow for moving configuration changes between orgs
Metadata API is a web service for managing metadata
Q13. Difference between Future and Queable Apex?
Future is asynchronous and runs in a separate thread, while Queueable Apex runs in the same thread but can be queued for execution.
Future methods are used for executing code asynchronously, while Queueable Apex is used for chaining jobs and running them in a specific order.
Future methods have a limit of 50 per transaction, while Queueable Apex has a limit of 50 jobs in the queue per transaction.
Future methods cannot be scheduled, while Queueable Apex can be scheduled for futu...read more
Q14. What is promise and promiseAll?
Promise is an object representing the eventual completion (or failure) of an asynchronous operation, and promiseAll is a method that takes an iterable of promises and returns a single Promise that resolves when all of the promises have resolved.
Promise is used in JavaScript to handle asynchronous operations.
It represents a value that may not be available yet, but will be resolved at some point in the future.
PromiseAll is a method that takes an iterable of promises and returns...read more
Q15. What is rollup summary field?
Rollup summary field is a field in Salesforce that calculates values from related records and displays the result on a parent record.
Rollup summary fields are used to perform calculations on child records and display the result on a parent record.
They can be used to calculate the sum, count, minimum, or maximum of a field in related records.
For example, a rollup summary field can be used to calculate the total amount of all opportunities related to an account.
Rollup summary f...read more
Q16. Write syntax for batch class
Batch class syntax in Salesforce
Batch class must implement Database.Batchable interface
Define start, execute, and finish methods
Use Database.executeBatch method to execute the batch class
More about working at Capgemini
Reviews
Interviews
Salaries
Users/Month