Posts

SOAP Integration in Salesforce

Image
If you don’t know the basics of SOAP fear not, because I've got you covered! Dive into the basics of SOAP with my latest blog, ' SOAP Explained: With JavaScript .’ Oh, you already know about SOAP and are here to learn how it works in Salesforce? You've come to the right spot! Let's get started. SOAP Integration in Salesforce SOAP is a protocol where client and server are tightly coupled meaning that minor changes on either side can potentially disrupt the connection.   To use SOAP API, your org must use Enterprise Edition, Performance Edition, Unlimited Edition, or Developer Edition. In all supported editions, a user must have the API Enabled permission turned on in the user profile they’re assigned.  In Salesforce, Apex SOAP web services(It is like a class) allow an external application to invoke Apex methods through SOAP Web services. The Web service that is available to you is defined in generated WSDL file. What is WSDL? Web Service Description Language is a file t...

How to Add a Dynamic Child List to Parent in Apex Class || Trigger using map

Last Updated: 13-01-2024 Map<parentId, List<child>>  Code without comments Map<id, List<object>> parentIdAndChildRecordsMap = new Map<id, List<object>>(); for(object childRecord : Trigger) { if(parentIdAndChildRecordsMap.containsKey(childRecord.parentId__c)) { parentIdAndChildRecordsMap.get(childRecord.parentId__c).add(childRecord); } else { parentIdAndChildRecordsMap.put( childRecord.parentId__c, new List<object>{childRecord} ); } } Code with comments // Define a map to store parent IDs and their associated child records Map<id, List<object>> parentIdAndChildRecordsMap = new Map<id, List<object>>(); // Iterate through each object in the Trigger context (likely a trigger context variable) for(object childRecord : Trigger) { // Check if the map already contains the parent ID if(parentIdAndChildRecordsMap.containsKey(childRecord.parentId__c)) { // Parent ID found, so add the child record to the exi...

Org2Org File Transfer in salesforce (code written in destination org)

Image
Last Updated: 09-11-2023   Let's define the terms we will use in this blog post: Source org - The org that has all the files. Current org (destination) - The destination org where all files are to be fetched from the source org. Because all code will be written in the destination org only; no coding will be done in the source org. To upload files from one Salesforce org to another using Salesforce REST APIs, you can follow these general steps:  Get Session Token , Org Base URL of source org. Get Record Ids from which we need to get the related files. Hit the  Salesforce REST APIs to fetch the files from source org.  Create Content Version in current org (destination). Create Content Document Link in current org (destination) which will associate the file with the record you want. Before going to code let's make our current org ready, we will create 2 fields in our object level  Ext_Record_Id__c - The record id of the record in the source org that we need to...

Database Methods vs. DML in Salesforce Apex

Image
  Apex contains the built-in Database class, which provides methods that perform DML operations and mirror the DML statement counterparts. These Database methods are static and are called on the class name. Database.insert() Database.update() Database.upsert() Database.delete() Database.undelete() Database.merge() Unlike DML statements, Database methods have an optional allOrNone parameter that allows you to specify whether the operation should partially succeed. When this parameter is set to false, if errors occur on a partial set of records, the successful records will be committed and errors will be returned for the failed records. Also, no exceptions are thrown with the partial success option. This is how you call the insert method with the allOrNone set to false. Database.insert(recordList, false); The Database methods return result objects containing success or failure information for each record. For example, insert and update operations each return an array of Database.Sav...

Editions and Licensing in salesforce

Image
What is Salesforce Editions? Salesforce offers various editions of its customer relationship management (CRM) platform to cater to the diverse needs of different businesses, from small startups to large enterprises. Each Salesforce edition comes with different features, capabilities, and pricing to address specific business requirements. Editions 1. Essentials Tailored for small businesses, it offers a user-friendly setup assistant and admin tools for customizable growth in CRM, boosting sales and service productivity. 2. Starter Your all-in-one solution for sales, service, and marketing, with user-friendly tools and built-in guidance, making it the quickest way to start with Salesforce CRM for first-time users looking to acquire, retain, and strengthen customer relationships. 3. Professional Ideal for businesses needing comprehensive CRM capabilities, offering user-friendly customization, integration, and administration tools for small to midsize deployments. 4. Ent...