salesforce questions and answers
1. What is Lightning?
12. What is the difference between profile and permission set?
- A lightning Component framework is a UI framework for developing responsive web apps,
- Single Page Application FrameWork,
- It Supports partitioned multi-tier component development that bridges the client and server,
- It uses JavaScript on the client-side and Apex on the server-side.
2. What is the use of Lightning Component Framework?
- Out-of-the-box set of components,
- Event-driven Architecture,
- Framework optimized for performance.
3. What is a component?
- Self-contained and reusable units of an app,
- A single line of code can use the entire app wherever want.
4. What is an aura framework?
- Aura is an open-source framework.
- Enables building apps completely independent of your data in Salesforce.
5. What is lightning App Builder?
- The Lightning App Builder, To build apps visually, without code, quicker than ever before using off-the-shelf and custom-built Lightning components.
- Make your Lightning components available in the Lightning App Builder so administrators can build custom user interfaces without code.
6. What is Attribute in Lightning component?
- Component attributes are
like a member variable on a class in apex,
- Component attributes Enable
the component to more dynamic
- <aura: attribute> tag
to add an attribute to the component or app,
- Attribute naming conventions
- Must begin with a letter or an underscore
- Must contain only alphanumeric or underscore
characters
<aura:application>
<aura:attribute
name="whom" type="String" default="world"/>
Hello {!v.whom}!
</aura:application>
7. What is the toast message in Lightning?
- Toasts are the simplest form of notification
- A developer can use toast to display a notification dynamically.
- Check the below link, How to do toasts in lightning pages:
- https://developer.salesforce.com/blogs/developer-relations/2017/08/displaying-user-notifications-lightning-component-framework.html
- Bulkify your Code
- Avoid SOQL Queries or DML statements inside FOR Loops
- Bulkify your Helper Methods
- Using Collections, Streamlining Queries, and Efficient For Loops
- Streamlining Multiple Triggers on the Same Object
- Querying Large Data Sets
- Use of the Limits Apex Methods to Avoid Hitting Governor Limits
- Use @future Appropriately
- Writing Test Methods to Verify Large Datasets
- Avoid Hardcoding Ids
9. Describe
OFFSET and give example and why we use it?
- OFFSET is a clause that is used in SOQL queries.
- When using offset only the first batch of records are returned for a given query.
- If you want to retrieve the next batch you will need to re-execute the query with the highest OFFSET Value.
- Example- A query like- [select id, name from Account limit 10 OFFSET 10] . Then it will return records from 11 to 20.
10 . Can we convert lookup into a master-detail relationship and
how?
Yes, we can convert
lookup to master but When we are converting lookup into master then any of the
lookup fields should not be blank, if there will be blank then populate values
in lookup fields then covert.
11. How to find which record is inserted/ updated in batch class?
Use SaveResult class like Database.SaveResult[] srLst=d atabase.update(lstData,
false); and there is isSuccess() method which finds the successfully record
inserted and getError() method used to get error from the failure record and by
using getId() method we can get failure records Id in class.
12. What is the difference between profile and permission set?
The difference between Profile and Permission Sets is Profiles are
used to restrict from something where Permission Set allows user to get extra
permissions.
Let's take an Example--
You have one profile assigned to 15
different users.
Now Suppose you want to give some extra permission
to one of the users. You have two options here.
a) To change Profile permissions: By this
way, those extra permissions will be received by every user who is having that
profile
b) Second way is to create a permission set
having that extra permission. You need to assign this permission set to a particular user by navigating to a User detail page. In this way, you don't have
to worry about other users, as only a specific user is getting those extra
permissions.
You can assign permission set as many users as you
want.
.