APEX TOP INTERVIEW QUUESTIONS AND ANSWERS :
In which object workflows are stored ?
Answer: Workflow
One company is having some branches and all branches having different departments. So, now I want to display all departments from all branches in a single visualforce page ?
Answer: Using subquery we can fetch all the required data and we can display it in VF page.
Will the inner class inherits the sharing properties of outer class ?
Answer: No, Inner classes do not inherit the sharing setting from their container class.
Classes inherit this setting from a parent class when one class extends or implements another.
I have an OWD which is read only, how all can access my data and I want to give read write access to a particular record to them, how can I do that ?
Answer:
All users can just Read the record.
Create a Sharing Rule to give Read/Write access with “Based on criteria” Sharing Rules. Learn Salesforce Training Online From Real Time Experts
What is the role hierarchy?
Answer: Role Hierarchy states that higher hierarchy person can see lower hierarchy person records.
In an apex invocation how many methods that we can write as future annotations ?
Answer: 10
What is the difference between role hierarchy and sharing rules ? will both do the same permissions ?
Answer:
Role Hierarchy states that higher hierarchy person can see lower hierarchy person records.
Sharing Rule is used to extend Role Hierarchy.
Where Products are added ?
Answer: Product2
Can I have constructor with parameters in apex ?
Answer: You do not need to write a constructor for every class. If a class does not have a user-defined constructor, a default, no-argument, public constructor is used. … In Apex, a constructor can be overloaded, that is, there can be more (pivotal training) than one constructor for a class, each having different parameters.
In how many ways we can invoke flows ?
Answer: We can invoke flows from different ways
From Apex
From Process Builder
Directly from the button invocation Top 50 Salesforce Apex Interview Questions and Answers Pdf
ENROLL FOR TRAINING
Can we create 2 opportunities while the Lead conversion ?
Answer: Yes using Apex code.
Is there a way to setup continous integration for apex tests ?
Answer: There are a couple of decent Dreamforce presentations here: Team Development: Possible, Probable, and Painless and Continuous Integration in the Cloud.
We ran into some issues with this in practice and there was no way to get true automation (i.e., set it and forget it). We were also setting it up with Selenium.
Here were the issues that I remember.
Some features aren’t supported in the metadata API and cannot be moved via the ant migration. If you have any unit tests that work with those features, you have to manually work on your CI org.
Deletions are harder to maintain. You have to manually update and apply a destructiveChanges.xml file or replicate the deletion in the CI org.
We ran into a situation where some metadata XML files had ‘invalid’ data in them. The suggested solution was to build a post (sap training) checkout script that manipulates the offending XMLs into valid XMLs. Not ideal.
On projects, we wanted to track just our changes and push out just our changes in source control. In theory, this would allow much easier rebaselining. This would have required more manual maintenance of XML files (e.g., 2 new fields added on Account and only want to push those 2 fields not all (*) fields).
My conclusion is that it is worth doing if you can get it set up, but if you are working on shorter term projects and don’t have a decent amount of time budgeted in for it, it probably isn’t worth setting up.
User1 is associated with profile “P”. If i create a permission set and assign it to User1, now will the Permission sets which we assigned overrides the existing profile “P” ?
Answer: No. The permission set is always used for extending the profile permission. It’s not used to override the Profile permissions.
Is there is any alternative for the “ActionPoller” ?
Answer: Using SetTimeout in Javascript and calling the apex method using apex:actionFunction.Salesforce Training Free Demo
Can we invoke flows from apex ?
Answer: Yes, We can call flows from apex.
What are the recommended ways to refactor in Apex ?
Answer: I use the second method. After refactoring, I select the ‘src’ folder, use File Search/Replace and all the changes are made and saved to the server in one go.
In which object all salesforce objects are saved ?
Answer: sObject
Write a query for below ?
Answer: I have 1 parent(account) and 1 child(contact),how will you get F.name,L.name from (learn salesforce online) child and email from the account when Organization name in account is “CTS”?
SELECT Email, (SELECT F.Name, L.Name FROM Contacts) WHERE Name = ‘CTS’.
What is External id ? primary id ?
Answer:
External id is unique to external application.
Primay id is unique to internal organization.
CLICK LINK BELOW:
0 Comments