Uncategorized

User Mode and System Mode of Apex Class in Salesforce.

Why do we have this concept in salesforce?

In salesforce there are many restrictions put on user in different ways, like OWD, Profiles, Field-Level Security, Object permissions, Sharing Rules, Role Hierarchy etc. But these restrictions do not apply to System Administrator. System admin has access to all records that are in system irrespective of owner or sharing rules or access to any object or field. An apex classes can be executed by any user in salesforce. An apex class can be triggered from a Visualforce Page, Visualforce Components, Lightning Components, Process Builder, Flow and many more ways. Class in salesforce can be executed in 3 modes in salesforce

  1. with sharing
  2. without sharing
  3. inherited sharing

Use the with sharing or without sharing keywords on a class to specify whether sharing rules must be enforced. Use the inherited sharing keyword on an Apex class to run the class in the sharing mode of the class that called it.

Continue reading “User Mode and System Mode of Apex Class in Salesforce.”
Governor Limits · Salesforce Basic

Apex Class, Variables, Constructor & Methods in Salesforce.

If you know Java or Dotnet applications, then you may observe that everything is written as a class. There are different access levels. You can also define class within a class just like inner class and outer class etc.

Salesforce also provides similar syntax that is followed in Java. Syntax can be to defining a class or variables in class or a wrapper class everything is similar to the syntax followed in Java programming.

Let us see a class and things that can be done in a class in Salesforce.

public class A_Class_Name{ 

        // Variables
	public static string a_Variable {get;set;}

        // Constructor
	public A_Class_Name(){
	        // Constructor business logic code
        }

        // Methods 
        public void a_Method_Name(Integer a_Variable1, Ingeter a_Variable2){
	        // Business logic code
        }
}
Continue reading “Apex Class, Variables, Constructor & Methods in Salesforce.”
Salesforce Basic

Apex Programming Language in Salesforce

Every technology has some or other programming language. There are well know programming languages namely, C, C++, Java, DotNet, Python, Javascript and many more. Object Oriented Programming Language (OOPS) is a concept on which most of the languages work. Similarly, Salesforce has its own programming language and it is called Apex Programming language.

Apex Programming language

Apex Programming language is strongly typed and works on OOPS concept. It uses similar syntax that looks like Java and acts like database stored procedures. Apex enables developers to add business logic to most of the system events which include button click, page load, related record update etc.

Continue reading “Apex Programming Language in Salesforce”
Governor Limits · Salesforce Admin

Salesforce Governor Limits and Solutions.

Before knowing what governor limits in salesforce is, let us understand what Multitenancy is?

Multitenancy’ is a fundamental technology that cloud uses to share IT resources cost-effectively and in securely.

Salesforce has many servers across globe and the org or salesforce instance that you work in will be in one of those servers. There servers will have huge database and machines and are so powerful that each server can host multiple instances of salesforce from different companies. So obviously every application will share resources that are available in the server like processor, database, network etc. Everything works smoothly without any deadlock situation. Such sharing of resources among different applications is called multitenancy.

If you speak in general, in a single building there will be many houses and different owners will own individual houses and resources such has, common space, water, garden area electricity will be shared among those people. Here building is like a server and you house is like your own application. There can be multiple applications in a server just like multiple houses in a building.

In this blog we will discuss 2 topics

  1. What are Governor Limits?
  2. How to Avoid Governor Limits.?
Continue reading “Salesforce Governor Limits and Solutions.”
Salesforce Admin

Different ways to Reset Password in Salesforce

Password is important for authenticating users. Users usually forget password or try multiple wrong passwords and many more reasons where system locks their credentials and restrict further access. A system admin can reset the password in many ways. In this blog we will see different ways through which you can reset the password.

As per my knowledge there are 3 ways you can reset password of a user in salesforce.

  1. User Detail page.
  2. Reset multiple users password at once.
  3. Developer Console
  4. Workbench
Continue reading “Different ways to Reset Password in Salesforce”
Salesforce Admin · Salesforce Basic · Security Model

Apex Sharing in Salesforce

There will be some scenarios in organization where you want to share a record based on some complex scenario, but you cannot define the complex scenario as a criterion in sharing rule. Then the question is how you can share a record, of course you can share them manually. But how many times you can share records manually, trust me its annoying to share records manually again and again.

Salesforce provides another way to share a record and that is through apex code via share object. So what is Share object? Every standard and custom object will have a share object in salesforce with predefined fields as shown below.

  • Standard Object’s Share object will be “sObject+Share”. For example, Account objects Share Object is AccountShare. Similarly, Opportunity objects Share object will be OpportunityShare.
  • Custom Object’s Share object will be “CustomObjectName + __Share”. For example, if your custom object name is MyCustomObject, then its API name will be MyCustomObject__c and share object will be MyCustomObject__Share.
Continue reading “Apex Sharing in Salesforce”
Salesforce Admin · Salesforce Basic · Security Model

Sharing Rules in Salesforce

There will be some scenarios where all records are privately owned, you want to share records based on some criteria with a specific user or group of users or to specific role. In such cases sharing automation should work on all records of that object. You can build a sharing rule which will handle such situation.

Consider a scenario where records should be shared based on continent field and those records should be shared with people of specific group or role. You can simple create sharing rules for each continent and share according to business requirement.

Continue reading “Sharing Rules in Salesforce”