Posts

Showing posts from July, 2017

Javascript remoting in salesforce

Javascript remoting  in salesforce can be useful in making a call to controller method without posting the whole form(<apex:form>) to server but whereas visualforce ajax functions( action function, action support, action poller) post the form. Javascript remoting in salesforce  let’s you pass parameter and it provides a callback function in which its parameter contains result returned back from apex method.  JavaScript remoting  allows you to run asynchronous actions by decoupling the page from the controller and to perform tasks on the page without having to reload the entire page, Apex  @RemoteAction  methods must be static and either global or public and requires you to write some JavaScript Apex Class :- global class JsRemotingExample { Public String name {get;set;} @RemoteAction public static String showText(String name) { return 'Hola '+name +', you did a server request to this method through Javascrip...

Displaying buttons on Apex Page Message

Image
Hi All, We might need to display button while showing page message to get user feed back.  Based on user feedback necessary action need to be taken care. For example Below is the code snippet.  <apex:pageMessages escape="false"/>  <apex:outputPanel rendered="{!isYesVisible}">         <apex:pageMessage severity="info" strength="3" summary="{!applicantMessage}">                           <apex:commandButton value="Yes" action="{!cloneOpportunity}"/>                 <apex:commandButton value="No" action="{!stayinSamePage}"/>                   </apex:pageMessage>             </apex:outputPanel>

SOQL vs SOSL explaination

SOQL vs SOSL explaination:- SOSL(Salesforce object search language) simplified :- Facebook graph search is much-a-like SOSL, After searching something you can see results returned from name,post, pages which in turn like returning a List of list of sObjects. SOQL(Salesforce object query language) simplified :- SOQL is like searching your Facebook friend list which in turn like returning a List of sObjects. Tabular comparison :- SOQL SOSL Data retrieval done via using ‘SELECT’ keyword Data retrieval done via using ‘FIND’ keyword Data retrieval from single object plus related objects Data retrieval from multiple objects. Much-a-like querying on single table Much-a-like querying on Multiple table SOQL and SOSL generally have the same limitations SOQL and SOSL generally have the same limitations Governor Limits on SOQL and SOSL :- SOQL Limits -> Total number of SOQL queries issued in synchronous mode is  100 , where in asynchronous mod...

Workflow vs process builder

Many times we come across situations where we have to decide whether i should use workflow rules or process builder. Below are few comparisons between them to help you to decide over the two. Workflows :- 1. Can be used to fire an action when any record is created or updated. 2. Can be used to fire an action when the record subsequently meets the workflow criteria    Eg:- We have a workflow rule which should fire an action when account type is "Hot".     If we select "subsequently meets" option then the workflow will fire when account type field is changed from some value to "Hot". 3. To update a field on the record initiated the workflow or to update the parent record field. 4. To send email alerts when the workflow is fired. 5. To create a task on the record which initiated the workflow. 6. To create an outbound message.     Outbound message are single line integrations to the third party system where we specify the     ...

Salesforce Pagination Technical Explanation

Pagination is used to display a list of records from an object in salesforce using standardset controller, Once you done setting up  standardController  attribute then you need to set attribute value to  recordSetVar  attribute value on the same component. recordSetVar  indicates the page uses a list controller. Also we need to use ‘ApexPages.StandardSetController’ in controller extension constructor for inheriting prebuilt salesforce standard object functionality. Now we can see an example on Pagination, Apex Class:- In the below Class, i am getting list of records in constructor using salesforce api method getRecord() and doing an explicit type casting to Account object ‘(Account)controller.getRecord()’ Then in ‘accountRecords’ getter method i am forming a query inside Database.getQueryLocator method which will return me list of accounts whose opportunity is not closed. Again using getAccountPagination() getter method i am retrieving ...