
Salesforce Hut
262 FOLLOWERS
All salesforce stuff under one roof
Salesforce Hut
2y ago
In this post we will update Contact department field with Account Industry if Contact Lead Source is 'other'. As we are updating contact again so it will cause recursion so to avoid that we have applied RECURSIVE Check. The class to check recursive is also included in this post ..read more
Salesforce Hut
2y ago
In this post, we have created one custom field Contact size on Account and we will update that contact size field based on insertion/deletion/updating of contact which is related to Account. In other term, we can say Roll-Up Summary through a trigger ..read more
Salesforce Hut
2y ago
In this post, we will update Contact field Mailing Address with Account Field Billing Address whenever Account billing address change ..read more
Salesforce Hut
4y ago
Case 1: When we have to do Callout
The above diagram shows how data flow from Salesforce to any other system. Where as what we want from system B to integrate with our Salesforce system.
Case 2: When we have to receive data from System B and exposing our web service class and URL
The above diagram represents when data is coming from any other system in the form of JSON/XML and where salesforce is the target/receiver. In this we have to create connected app and needs to provide the credentials, username, passwords etc to System B ..read more
Salesforce Hut
4y ago
In this post, we will see how to establish Parent-Child relations using Map in Salesforce. By this method, you can easily find all the child values its sizes etc that is associated with its Parent record.
After that, we will also see the small example where there is a Trigger on contact and which will give the size of Contact on Account object.
Example For Roll-Up Summary using Above Relation ..read more
Salesforce Hut
4y ago
What is OOPs
Object-oriented programming is a programming paradigm based on the concept of "objects", which can contain data, in the form of fields, and code, in the form of procedures. It allows users to create the objects that they want and then create methods to handle those objects.
The OOPs that we deal in Apex are:
Object
Class
Inheritance
Polymorphism
Abstraction
Encapsulation
Object
Real World: - Any entity that has state and behavior is known as an object. It can be physical and logical. eg:- Car, bike, book, ball, etc.
Technical: An object can be defined as an insta ..read more
Salesforce Hut
4y ago
Definition - Future Apex is used to run processes in a separate thread, at a later time when system resources become available
Benefits
Some governor limits are higher, like SOQL query and heap size limits.
Prevent mixed DML error.
The process runs in the background, asynchronously.
Important Points
A future method must be a static method.
It only returns void type.
The future method can’t take object and sObjects as parameters.
Parameters must be primitive data types like arrays of primitive data types, or collections of primitives data types.
Future methods can’t invoke another fu ..read more
Salesforce Hut
4y ago
In this post we are Integrating one Salesforce Org (Org A) to another Salesforce Org (Org B), in which we will fetch Account details from Target org by passing account number. Before writing code you need to do some settings as mentioned below:
Org A (Source Org)
You need to set the endpoint URL of Target Org in the Remote Site setting (setup >> Remote Site Setting).
Then you need to write a) API Class. b) Lightning Component to show details
Org B (Target Org)
Create a connected app (please refer image below) and obtain clientId, clientSecret, username, password (a c ..read more
Salesforce Hut
4y ago
In this post we are Integrating one Salesforce Org (Org A) to another Salesforce Org (Org B), in which If a record is created in Org A it will automatically create in Org B. Before writing code you need to do some settings as mentioned below:
Org A (Source Org)
You need to set the endpoint URL of Target Org in the Remote Site setting (setup >> Remote Site Setting).
Then you will write the a) Future callout class. b) Trigger which call Future Class on Insertion
Org B (Target Org)
Create a connected app (please refer image below) and obtain clientId, clientSecret, usernam ..read more
Salesforce Hut
4y ago
In this post, we will see how to create JSON through JSON Generator and send it through Future callout.
This program has 2 methods. First method create JSON of Case and its related Account, Asset and CaseComments with JSONGenerator. Second method takes the JSON and callout to the desired endpoint URL. As this is separated in 2 methods because if the first method has DML operation then it should be complete first to call the Future method.
Note: Please make Remote Site URL in your Org ..read more