Apex Archives

How to get Salesforce object records with only required fields in Apex

Author - Webner
|
0 Comments
|

Problem:

If you want to get records with dynamic fields (all fields or only required fields) selection of an object in Salesforce.

Solution:

List normalFields = new List();
List requiredFields = new List();
Schema.DescribeSObjectResult objectDetails =
ObjectName.sObjectType.getDescribe();
Map fieldsMap = objectDetails.fields.getMap();
for(String fieldName : fieldsMap Read more…

Convert Set data into String

Author - Webner
|
0 Comments
|

Introduction

When working with sets in apex sometimes we need to create a string from the set’s values but there is no function that can convert a set into a string as we have for lists. To convert set into a string we can use these two Read more…

Delete and deploy components from production using workbench

Author - Webner
|
0 Comments
|

How to delete and deploy components (Apex classes, Flows, Objects, etc) from production using workbench?

We cannot delete Apex classes directly from the Production org. Also, it is not possible to deploy deleted apex classes using Changeset. So, to delete them we can use these tools – Workbench, IDE Read more…

Create Post Install Script in SalesForce

Author - Harinder Jakhar

How to create Post Install Script in SalesForce

Definition
A post install script is an Apex class which is executed when a package is installed or upgraded. This class implements the InstallHandler interface. This interface has a method named as onInstall which specifies what Read more…