How to get first element of set using Apex in Salesforce?
Sample Code: Set<String> setStr = new Set<String> {'abc', 'xyz'}; String first = new List<String> (setStr).get(0); //returns abc Cheers!!!
Sample Code: Set<String> setStr = new Set<String> {'abc', 'xyz'}; String first = new List<String> (setStr).get(0); //returns abc Cheers!!!
1. Create a custom field Previous_Case_Status__c in the Case object to capture or store case's previous status in Salesforce. 2. Use the following trigger. Sample Trigger: trigger Case_BU on Case (before ....
Hi All, Salesforce.com is really a good CRM tool. To experience it just create an account in developer edition and enjoy. To create a developer account, kindly use the below link ....
Sample Code: Map<Id, List<Contact>> mapAcctIdContactList = new Map<Id, List<Contact>>(); List<Contact> listContact = [SELECT Id, FirstName, AccountId FROM Contact]; for(Contact con : listContact) { if(String.isNotBlank(con.AccountId)){ ....
Sample Package.xml: <?xml version="1.0" encoding="UTF-8"?> <Package xmlns="http://soap.sforce.com/2006/04/metadata"> <types> <members>Account-Account Layout</members> <members>Contact-Contact Layout</members> <members>Employee__c-Employee Layout</members> <name>Layout</name> ....
Sample Visualforce page: <apex:page > <script> function show(){ alert('Test'); } </script> <apex:form > <apex:pageBlock > <apex:pageBlockButtons ....
Apex Class: public class CommonVariables { public Static Boolean caseRepeatCheck = true; } Sample Trigger: trigger CaseTrigger on Case (after insert) { if(CommonVariables.caseRepeatCheck) { ....
Sample Code: Visualforce page: <apex:page controller="SampleController"> <apex:form > <apex:pageBlock > <apex:pageBlockTable value="{!empList}" var="e"> <apex:column value="{!e.Name}"/> ....
Visualforce page: <apex:page controller="PDFController"> <apex:pageBlock > <apex:pageBlockTable value="{!listEmployees}" var="e"> <apex:column value="{!e.Name}"/> <apex:column value="{!e.Age__c}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:page> Apex Controller: public class PDFController { public List<Employee__c> listEmployees {get;set;} public PDFController() { listEmployees ....
If apex:outputText not showing decimal places issue, kindly check the initialization of variables. Sample code: If it is Double, Double a = 0.0; If it is Decimal, Decimal d = 0.00; Cheers!!!