How to Display Error/Information messages in Visualforce Pages
Learn How to Show Error/Information Message in Visualforce Page Many case user want to display multiple error/warning/information message in the UI(Visualforce Page). Please find below sample code Apex Code : ApexPages.addmessage(new ApexPages.message(ApexPages.Severity.Info, 'Please fill all manfaroty fields.')); ApexPages.addmessage(new ApexPages.message(ApexPages.Severity.Error, 'Name is manfatory.')); ApexPages.addmessage(new ApexPages.message(ApexPages.Severity.WARNING, 'Need
Refer Object Field Label Name in Visualforce
How to Get the Label Names for Refer Object's Field in Salesforce? Many case we many need to use object field label name in the Visualforce page. We can use “$ObjectType” system class. Sample Code : <apex:outputLabel value="{!$ObjectType.Account.fields.Name.label}" />
About My Salesforce Development Experience
About Sathish SFDC- Salesforce Development Experience Journey I have started my salesforce by accident – I was working on SharePoint 2007 designer and one of my practices lead asked me “are you interested work salesforce?”. I was so confused and did little
Schedule managed package controllers using Developer Console
Schedule Managed Package Controllers Using Developer Console Many case we will get request to schedule apex class for specific time that is not possible through OOB functionality. So we have to us developer console to schedule job like 12:15 AM, 1.15
How to create domain in Salesforce
Create a Custom Domain Using My Domain Feature in Salesforce Salesforce domin is mandatory for Authentication and Authorization. Once domain setuped in your org – you can’t revert/change domain name. Please follow below step to create My Domain in your salesforce org 1.Login to
How to get your org complete metadata component package.xml
Go to this URL : https://packagebuilder.herokuapp.com/ Click “Package Builder” Select your environment Provide your login credential Click Login Salesforce Button and Choose Component and Click Get Component button Here you go with Package.xml
Get Record Type ID without SOQL Query
Many scenario’s developers hard coding record type id or name in the apex class or test class. Please refer below sample code to get id or name without SOQL query Record Type Id by Name Record Type Name , ID map collection
Dynamic SOQL Query using sObject
Please use below sample code to form SOQL query string based on user field level access permission. Code : public static string generateDynamicSOQLQuerybysObject(String objectName){ String selects = ”; Map<String, Schema.SObjectField> fMap = Schema.getGlobalDescribe().get(objectName.toLowerCase()).getDescribe().Fields.getMap(); list<string> selectFields = new list<string>(); if (fMap != null){ for (Schema.SObjectField ft : fMap.values()){
Dynamic SOQL Query using sObject with Reference Object Fields
Generate dynamic SOQL query with “__r” fields. Code : public static string generateDynamicSOQLwithReferenceField(String objectName, String strRefField) { String selects = ”; Map<String, Schema.SObjectField> fMap = Schema.getGlobalDescribe().get(objectName.toLowerCase()).getDescribe().Fields.getMap(); list<string> selectFields = new list<string>(); if (fMap != null){ for (Schema.SObjectField ft : fMap.values()){ Schema.DescribeFieldResult fd = ft.getDescribe(); selectFields.add(fd.getName()); } } if (!selectFields.isEmpty()){ for (string s:selectFields){ selects +=
Salesforce Encrypted SSN/CreditCard Field Limitation
SSN Field Encryption & Shield/Credit Card Field Limitation – SFDC Salesforce have ability to display the secured data in encrypted format. It is salesforce out of box functionality. You can create new Text(Encrypted) using “Custom Fields & Relationships” on the object. Advantages