We can get the Ids of Salesforce Object’s custom fields in the Apex code using Tooling API. Following is the example code for the same:
String objectDevName = ‘ObjectName’;
ToolingAPI toolingAPI = new ToolingAPI();
List objectData = (List)toolingAPI.query(‘Select Id From CustomObject Where DeveloperName = \” + objectDevName + ‘\”).records;
Map customFieldIds = new Map Read more…
If you want to get records with dynamic fields (all fields or only required fields) selection of an object in Salesforce.
List normalFields = new List();
List requiredFields = new List();
Schema.DescribeSObjectResult objectDetails =
Map fieldsMap = objectDetails.fields.getMap();
for(String fieldName : fieldsMap Read more…
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…
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…
How to create Post Install Script in SalesForce
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…