Apex Code – Static Factory for Record Type
Use below apex class to avoid duplicate in your org to pull record type, Profile, User, Environment, Sandbox name, Group Name, Queue Name related information. This is very helpful to me – I was using separate apex class for each area
How to validate String as Salesforce Record Id using InstanceOf keyword?
Validate String as Salesforce Record Id Using InstanceOf Keyword I had scenario where store multiple user in custom settings with “;” separator. Used that custom settings to skip the trigger for few scenario like data load, running batch job… Some time
Find Sandbox Name from Your Sandbox Org
Learn How to Find Sandbox Name From Sandbox Org in Salesforce Many of having trouble to find sandbox name from your Sandbox org. There is no direct way to get it but we have workaround. Please follow below steps Create list custom
Use Salesforce Custom Permission. Don’t use Profile/User id to skip validation rule.
Salesforce Custom Permission to User to Access Custom Process Use salesforce custom permission to user to access custom process or apps. Many use case – validation rule should not executed for admin profile or specific user. Right now admin/developer hard coding profile/user
How to export(CSV/Excel) Salesforce Reports using Apex and send email
Export(CSV/Excel) Salesforce Reports Using Apex And Send Email There are many case – user want to review data weekly or monthly base but they want to data as CSV/Excel file in the Email. Many of now writing apex batch job to generate
Redirect to Visualforce page from Custom Button using OnClick Javascript
You have to write javascipt code to redirect to VF page standard custom button. Should use window.location function to redirect to VF page. Example: {!REQUIRESCRIPT('/soap/ajax/26.0/connection.js')} var accReq = "{!Account.Name}"; if(accReq != '') { window.location="/apex/VisualforceName?id={!Account.Id}"; } else { alert('Name is mandatory'); window.location.reload(); }
How to skip salesforce lookup filter?
How to Avoid Performing a Salesforce Lookup Filter Uses a Picklist? There are many scenario user don’t want to fire lookup filter like while running some apex job or generating billing related record. How to skip lookup filter? Create a checkbox field on
How to find list of custom object prefix decoder in your org?
Learn How to Find List of Custom Object Prefix Decoder in Your org Please run below script in your developer console Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe(); for(String str : gd.keySet()) { Schema.SObjectType obj = gd.get(str); Schema.DescribeSObjectResult objResult
How to export Salesforce Object field name into CSV file?
Learn How to Export Salesforce Object Field Name Into CSV File? Please run below script through developer console you will receive a email with list of field for that object. Note: Please replace with your email address and object based on your
How to schedule apex job every 15 min?
Please use below code to schedule you job every to 15 min System.schedule('Scheduled Job 1', '0 0 * * * ?', new ScheduledClass()); System.schedule('Scheduled Job 2', '0 15 * * * ?', new ScheduledClass()); System.schedule('Scheduled Job 3', '0 30 * * * ?',