Infosys
30+ Coditas Technologies Interview Questions and Answers
Q1. How do you make the child records read only of its parent record's field is updated to some value
Child records can be made read-only when parent record's field is updated using validation rules.
Create a validation rule on child object
Use ISCHANGED() function to check if parent field is updated
Use PRIORVALUE() function to get the previous value of parent field
Use ISBLANK() function to check if the previous value of parent field is blank
Use ISNEW() function to allow creation of child records
Use OR() function to combine all conditions
Throw an error message if all conditions...read more
Q2. How do you call a controllor method from javascript in visualforce page?
To call a controller method from JavaScript in a Visualforce page, use the actionFunction tag.
Create a controller method in the Apex class.
Add an actionFunction tag in the Visualforce page.
Call the actionFunction from JavaScript using its name.
Pass parameters to the controller method using the actionFunction tag.
Use the rerender attribute to update the page after the controller method is called.
Q3. How do load both parent and child records at a time using data loader?
Use data loader's parent-child functionality to load both parent and child records at once.
Create a CSV file with both parent and child records
Use the data loader's parent-child functionality to map the relationship between the two
Ensure that the parent records are loaded before the child records
Use the data loader's insert or upsert operation to load the data
Q4. What are the collectio variables and when do we use them in apex?
Collection variables are used to store multiple values of the same data type in Apex.
Collection variables include Lists, Sets, and Maps.
Lists are ordered collections of elements that can contain duplicates.
Sets are unordered collections of unique elements.
Maps are collections of key-value pairs.
Collection variables are useful for iterating over multiple values and performing operations on them.
Example: List
names = new List {'John', 'Jane', 'Bob'}; Example: Set
numbers = new Se...read more
Q5. Write a trigger to update a field on child record a default value if the child record is the only child of parent
Write a trigger to update a field on child record with default value if it is the only child of parent
Create a trigger on the child object
Query for the parent record and check if it has only one child record
If the parent has only one child, update the field on the child record with the default value
Q6. Write a trigger to update StageName on Opportunity whenever the Account Active field is set to Yes
Trigger to update StageName on Opportunity when Account Active field is set to Yes
Create a trigger on Account object
Query for related Opportunities
Update StageName field on Opportunities where Account Active is Yes
Q7. Syntax of batch class, future method
Batch class and future method syntax in Salesforce development.
Batch class syntax: Implements Database.Batchable interface, has start(), execute() and finish() methods.
Future method syntax: Has @future annotation, returns void, takes parameters.
Example batch class syntax: public class MyBatch implements Database.Batchable
{ ... } Example future method syntax: @future public static void myFutureMethod(String param) { ... }
Q8. Write a trigger to update field on child record from parent record.
Use trigger to update child record field from parent record
Create a trigger on the parent object
Query for the child records related to the parent record
Update the field on the child records with the desired value
Q9. When would trigger be in read only context?
Triggers are in read-only context when they are executed in a transaction that is read-only.
Triggers are in read-only context when they are executed in a transaction that is read-only.
This can happen when triggers are fired by a record being deleted, undeleted, merged, or when a workflow rule or process builder updates a record.
In read-only context, triggers cannot perform DML operations like insert, update, delete, undelete on other records.
Q10. Write a LWC to display contacts associated to an account.
LWC to display contacts associated to an account
Create an Apex class to fetch contacts associated with the account
Use Lightning Data Service to retrieve account details
Display contacts in a Lightning web component using HTML and CSS
Q11. what are the trigger events in Salesforce
Trigger events in Salesforce are actions that can cause a trigger to execute.
Before Insert
Before Update
Before Delete
After Insert
After Update
After Delete
After Undelete
Q12. Parent to child and child to parent communication in LWC
Parent to child and child to parent communication in LWC
Use @api decorator to expose properties from parent to child
Use CustomEvent to communicate from child to parent
Use Lightning Message Service for communication between unrelated components
Q13. How can we achieve record sharing in salesforce
Record sharing in Salesforce can be achieved through sharing rules, manual sharing, and criteria-based sharing.
Use sharing rules to automatically grant access to certain records based on criteria
Use manual sharing to manually grant access to specific users or groups
Use criteria-based sharing to define sharing rules based on specific criteria
Q14. Trigger to count no of opportunitylineitems and display in Accout custom field
Create a trigger to count Opportunity Line Items and display in Account custom field
Create a trigger on OpportunityLineItem object
Use SOQL query to count the number of Opportunity Line Items related to the Account
Update the custom field on Account with the count value
Q15. write rollup summery on account object and contact
A roll-up summary field calculates values from related records and displays the result on a parent record.
Roll-up summary fields can be created on the parent object to display aggregated data from child records.
They can be used to calculate the sum, count, minimum, maximum, or average of a field on the child object.
Roll-up summary fields are automatically updated when the child records are created, edited, or deleted.
They can be used to display information like the total amou...read more
Q16. 1. Write a trigger for de-duplication of records
A trigger for de-duplication of records in Salesforce
Create a trigger on the object you want to de-duplicate
Use SOQL query to find duplicate records based on specific criteria
Merge duplicate records or mark them as duplicates
Q17. How to call LWC from flows
To call LWC from flows, create an Aura component that wraps the LWC and call the Aura component from the flow.
Create an Aura component that wraps the LWC component
Expose the LWC component as a public property in the Aura component
Call the Aura component from the flow using the 'Lightning Component' element
Q18. Explain composite resources in salesforce?
Composite resources in Salesforce are resources that represent multiple related objects in a single request.
Composite resources allow you to make multiple API calls in a single request, reducing network latency and improving performance.
They are useful for operations that involve multiple related objects, such as creating a new account and related contacts in a single transaction.
Composite resources can be used with REST API and Bulk API in Salesforce.
Q19. what is permission set
Permission set is a collection of settings and permissions that define what a user can do in Salesforce.
Permission set is used to grant additional permissions to users beyond their profile settings.
It allows administrators to give specific access to objects, fields, tabs, and other features.
Multiple permission sets can be assigned to a user to provide a combination of permissions.
Permission sets can be used to extend the functionality of profiles without changing the profile ...read more
Q20. Apex trigger to update lastName
Apex trigger to update lastName
Create an Apex trigger on the object where lastName needs to be updated
Use trigger.new to access the records being updated
Update the lastName field with the desired value
Q21. What are decorators in LWC
Decorators in LWC are functions that are used to modify the behavior of class properties or methods.
Decorators are used to add metadata to class members in Lightning Web Components.
They are declared using the @ symbol followed by the decorator name.
Decorators can be used for various purposes such as tracking changes, validating input, or controlling access to properties.
Q22. what is a sandbox?
A sandbox is a separate environment for testing and developing applications without affecting the production environment.
A sandbox is a copy of the production environment where developers can experiment and make changes without impacting live data.
It allows developers to test new features, configurations, and integrations before deploying them to the production environment.
Sandbox environments can be refreshed with the latest data from the production environment to ensure acc...read more
Q23. Explain Mixed DML error?
Mixed DML error occurs when DML operations on setup and non-setup objects are mixed in a single transaction.
Occurs when trying to perform DML operations on both setup and non-setup objects in a single transaction
Setup objects include User, Profile, PermissionSet, etc.
Non-setup objects include custom objects, standard objects like Account, Contact, etc.
Can be resolved by splitting the DML operations into separate transactions or using @future annotation for one of the operatio...read more
Q24. what is Batch Apex
Batch Apex is a Salesforce feature that allows for processing large amounts of data in batches to prevent hitting governor limits.
Batch Apex is used to handle large data volumes by breaking the processing into smaller batches.
It is useful for operations like data cleansing, data migration, and data integration.
Batch Apex jobs can be scheduled to run at specific times or can be executed manually.
It helps in preventing hitting governor limits like CPU time limit and heap size l...read more
Q25. How do you debug LWC
Debugging LWC involves using browser developer tools, console logs, and Salesforce Lightning Inspector.
Use browser developer tools to inspect elements and check for errors.
Utilize console logs to track variables and identify issues in the code.
Use Salesforce Lightning Inspector to debug server-side Apex calls and network requests.
Q26. Decorators in lwc
Decorators in LWC are special functions that can be used to modify the behavior of a class or its members.
Decorators are declared using the @ symbol followed by the decorator name.
They can be used to add metadata, modify class behavior, or extend functionality.
Some commonly used decorators in LWC include @api, @wire, and @track.
Example: @api decorator is used to expose a property or method to be used in parent components.
Q27. what is batch class
Batch class is used in Salesforce to process large amounts of data asynchronously.
Batch class is used to handle large data volumes in Salesforce.
It allows you to break down a large job into smaller chunks for processing.
Batch class implements the Database.Batchable interface in Salesforce.
Example: A batch class can be used to update all account records in Salesforce.
Example: A batch class can be used to delete all old records from a custom object.
Q28. best practices of trigger
Best practices for triggers in Salesforce development
Use trigger handlers to separate logic from the trigger itself
Avoid using SOQL queries or DML statements inside loops
Leverage bulkification to process records in batches
Consider using trigger frameworks for better organization and maintainability
Write unit tests to ensure trigger functionality and coverage
Q29. REST SOAP APIs differences
REST and SOAP APIs are different in terms of architecture, communication, and data formats.
REST is based on HTTP protocol and uses standard methods like GET, POST, PUT, DELETE, while SOAP is a protocol-agnostic and uses XML for communication.
REST is lightweight and easier to use, while SOAP is more rigid and has more security features.
REST APIs are stateless, while SOAP APIs can maintain state between requests.
REST APIs are more popular for web services, while SOAP APIs are c...read more
Q30. Asynchronous Apex
Asynchronous Apex is used to run processes in the background without user interaction.
Asynchronous Apex is used for long-running processes, such as callouts to external systems or batch processing.
It allows for better performance by not blocking the user interface while the process is running.
Examples include @future methods, Queueable Apex, and Batch Apex.
Top HR Questions asked in Coditas Technologies
Interview Process at Coditas Technologies
Top Salesforce Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month