AggregateResult in Salesforce
AggregateResult in Salesforce is used to find Sum, Min, Max and Avg. It is similar to Aggregate function in SQL. Using Aggregate Result, we cannot fetch data. It is mainly ....
AggregateResult in Salesforce is used to find Sum, Min, Max and Avg. It is similar to Aggregate function in SQL. Using Aggregate Result, we cannot fetch data. It is mainly ....
Sample Code: Visualforce page: <apex:page controller="Sample" sidebar="false" action="{!fetch}" contentType="text/plain/#emp.txt" cache="false"> Employee Number : {!emp.Name} Employee Name : {!emp.Employee_Name__c} City : {!emp.City__c} Email : {!emp.Email__c} Description : {!emp.Description__c} </apex:page> Apex Controller: ....
Sample Code: Visualforce page: <apex:page controller="Sample" sidebar="false"> <apex:pageBlock > <apex:repeat value="{!numbers}" var="num"> <apex:outputText >{!num}</apex:outputText> <br/> </apex:repeat> </apex:pageBlock> </apex:page> Apex Controller: public class Sample { public List<Integer> numbers {get;set;} Transient Integer ....
Apex Controller: public class acctTemplt { public Id accountId {get;set;} public List<Opportunity> getopptys() { List<Opportunity> oppty; oppty = [SELECT Name, StageName FROM Opportunity WHERE Accountid =: accountId]; return oppty; } ....
Only standard style sheets can be used in apex:pageBlockTable tag in aVisualforce page. <apex:pageBlockTable> must be contained in <apex:pageBlock> or <apex:pageBlockSection>. If we want to add custom style sheets we have to use apex:dataTable tag ....
Multiple ids should be used in the reRender attribute to Rerender multiple sections in VisualForce page. Sample Code: Visualforce page: <apex:page controller="SampleVisualforcePageController"> <apex:form > <apex:pageblock > <apex:pageblockSection id="membersBlock" title="Member Details" > ....
Sample Code: Visualforce page: <apex:page controller="Sample" sidebar="false" ><apex:pagemessages /><apex:form > <apex:pageblock > <apex:pageBlocksection > <apex:pageblockSectionItem >Name:</apex:pageblockSectionItem> <apex:pageblockSectionItem ><apex:inputtext value="{!nam}" /></apex:pageblockSectionItem> <apex:pageblockSectionItem >Age:</apex:pageblockSectionItem> <apex:pageblockSectionItem ><apex:inputtext value="{!age}" /></apex:pageblockSectionItem> ....
Salesforce provides REST API to Create, Update and Delete records. We can also define Apex as a REST Service to Create, Update and Delete records in Salesforce. Example: Follow the ....
Database.setSavepoint() in Salesforce apex can be used to rollback the transaction to a point. It helps in partial rollback on the transactions. Database.setSavepoint() is used to define a point at ....
Apex Class: global class approvalRecall { webservice static void recallApproval(Id recId) { List<ProcessInstanceWorkitem> piwi = [SELECT Id, ProcessInstanceId, ProcessInstance.TargetObjectId FROM ProcessInstanceWorkitem WHERE ProcessInstance.TargetObjectId =: recId]; Approval.ProcessWorkitemRequest req ....