Posts

Showing posts from 2011

Displaying pop-up summaries on hover in visualforce

What if I want to make a summary pop-up window when a user hovers over a link in a visualforce page. This Feature is easy in standard salesforce pages, mostly because it happens automatically. But not in visualforce pages. I have seen most of example for pop-up in salesforce were created using the output panels with some embedded styles.   Here I'm posting a pop-up example which show the details of a partuclar record on a mouseover using the Hover links similar to those used in standard Salesforce links.  /*visualforce page*/ <apex:page controller="PopupTest"> <apex:form > <apex:repeat value="{!accounts}" var="acc"> <br/> <a href="/{!acc.Id}" id="{!acc.Id}" onblur="LookupHoverDetail.getHover('{!acc.Id}').hide();" onfocus="LookupHoverDetail.getHover('{!acc.Id}', '/{!acc.Id}/m?retURL=%2F{!acc.Id}&isAjaxRequest=1').show(...

Summer '11 New Features - part 1 (Javascript Remoting)

JavaScript remoting was released as a Developer Preview in Spring '11. In Summer '11, JavaScript remoting now supports additional return data types. Also, references to the same objects are no longer duplicated in the response. Javascript remoting is the process that provides support for some methods in APEX controllers to be called via Javascript. This is an interesting feature and it'll be a good move to the interactive and fast user interface creation in visualforce. I have mentioned about javascript remoting one of my previous post . There is a nice example about Javascript Remoting.

Real-time sandbox environments in Salesforce

A sandbox is basically a replication of your Salesforce org you can use for development , testing, and training without disrupting your production environment. Sandboxes are completely isolated from your Salesforce production organization, so anything you do in your sandboxes will not affect your Salesforce production application, and vice-versa. Sandbox provides a set of tools that deliver real, tangible business benefits and it’s not just for developers. If you make a mess of things, your “real” data and org is protected and your sandbox can be refreshed 29 days from its creation or from the last refresh. You can be created a sandbox in production environment; Setup > Administration Setup > Data Management > Sandbox There are three types of sandboxes available to Salesforce.com customers. Configuration-only sandbox Configuration-only sandboxes copy all your production organization’s reports, dashboards, price books, products, apps, and customizations, but exclu...

Parameter passing using Javascript+actionFunction in visualforce

In visualforce, there is a method for passing parameters from visualforce page to controller using javascript and actionFunction. Here is the example; /*JavaScript*/ <script type="text/javascript"> function doSave(date) { paraFunction(document.getElementById(date).value); } </script> /*Action Function*/ <apex:actionFunction name="paraFunction" action="{!saveInterviewDate}" rerender="view"> <apex:param id="aname" name="interviewDate" value="" /> </apex:actionFunction> /*Call the javaScript from here*/ <apex:commandLink onclick="doSave('{!$Component.interviewDate}');"> <apex:commandButton value="Save"/> </apex:commandLink> /*get the parameter in controller*/ String interviewdate=Apexpages.currentPage().getParameters().get('interviewDate');

Javascript Remoting for APEX controller

Javascript remoting is the process that provides support for some methods in APEX controllers to be called via Javascript.The @RemoteAction annotation is currently available as a Developer preview.You have to contact Salesforce.com support to enable this feature.To use Javascript remoting, your request must take the following form: [<namespace>.]<controller>.<method>([params...,] <callbackFunction>(result, event) { // callback function logic }, {escape:true}); namespace is your organization's namespace. This is only required if the class comes from an installed packaged. controller is the name of your Apex controller method is the name of the Apex method you're calling params is the comma–separated list of parameters that your method takes callbackFunction is the name of the function that handles the response from the controller. It returns the status of the call and the method result. escape defines whether your response should be escaped (by defau...

Javascript with Visualforce pages

Javascript is one of key browser technology on Visualforce pages. Javascript provides the framework for communication between other Javascript objects, HTML elements and visualforce controller. This example will explain how can we use javascripts in visualforce pages. <apex:page> <script> function changeFont(input, textid) { if(input.checked) document.getElementById(textid).style.fontWeight = "bold"; else document.getElementById(textid).style.fontWeight = "normal"; } </script> <apex:outputPanel layout="block"> <label for="checkbox">Click this box to change text font: </label> <input id="checkbox" type="checkbox" onclick="changeFont(this,'{!$Component.thePanel}');"/> </apex:outputPanel> <apex:outputPanel id="thePanel" layout="block">Change me! </apex:outputPanel> </apex:page> '{!$Component.idName}' : This is the way...

Multi-Currency in Salesforce.com

Basically the multi-currency feature is not available in your organization on salesforce. We have to log a case or contact salesforce support team for activate the multi-currency feature on your organization. This request can only be made by a System Administrator Prior to converting your organization to multi-currency, some aspects of this feature that should be reviewed. The Multi-Currency functionality CANNOT be turned off once it is activated. Salesforce.com support team also recommends testing the activation in a Sandbox environment. The process locks the org when turning on Multi Currency (preventing users from logging in), this can take 30 minutes or more depending on the size of the organization. After activate this feature on your organization, you will have a standard field called "CurrencyIsoCode" as picklist in ont only standard objects but also in custom objects And You will have a place to manage your currencies in following path; Your Name-->Setup-->Admi...

Inline Editing in Visualforce page

Inline editing in Visualforce was introduced with the Spring'11. It has the ability to turn on inline editing within Visualforce, a handy bit of user friendliness which has been availability in the standard application interfaces for some time. Enabling inline editing is simple. My example is related with the Contact Standard object. But this feature will work with custom objects as well. <apex:page standardController="Contact"> <apex:form > <apex:pageBlock mode="inlineEdit"> <apex:pageBlockButtons > <apex:commandButton action="{!edit}" id="editButton" value="Edit"/> <apex:commandButton action="{!save}" id="saveButton" value="Save"/> <apex:commandButton onclick="resetInlineEdit()" id="cancelButton" value="Cancel"/> </apex:pageBlockButtons> <apex:pageBlockSection > <apex:outputField value="{!cont...

Save an attachment in APEX

Attachment field allows users to be able to attach notes and attachments to custom object records. This allows you to attach external documents to any object record, in much the same way that you can add a PDF or photo as an attachment to an email. This option is only available when you are creating a new object. Here I have an example for save an attachment in APEX. /*****Controler*****/ public class status{ private final Applicant__c applicant; public Blob resume {get; set;} public String contentType {get; set;} public String fileName {get; set;} public status(ApexPages.StandardController stdController) { this.applicant=(Applicant__c)stdController.getRecord(); } public PageReference saveApplication() { try{ insert(applicant); }catch(System.DMLException e){ ApexPages.addMessages(e); return null; } if(resume!=null){ Attachment attach=new Attachment(); attach.Body=resume; attach.Name=filename; a...

What is Salesforce?

Image
Salesforce CRM is a web-based Customer Relationship Management (CRM) service. It allows you to create a single view of your customers and leads, coordinate your sales, marketing and customer service activities and provides an overview into how your business is operating. You can generate, manage, and report on leads, opportunities and track results from first contact to won or lost business. You can see the results of your marketing campaigns and understand their impact using real-time analytics. It helps to improves efficiency, reduces administration time and lets you focus more on your business by reducing the time taken to search for information by providing a centralized service. Salesforce has several products and service categories such as Sales cloud, Service cloud, Data cloud, Collaboration Cloud (including Chatter) and Custom Cloud (Force.com).

Cloud Computing

Image
Cloud computing is a technology that uses the internet and central remote servers to maintain data and applications. Cloud computing allows consumers and businesses to use applications without installation and access their personal files at any computer with internet access. This technology allows for much more efficient computing by centralizing storage, memory, processing and bandwidth. Cloud computing comes into focus only when you think about what IT always needs: a way to increase capacity or add capabilities on the fly without investing in new infrastructure, training new personnel, or licensing new software. Cloud computing encompasses any subscription-based or pay-per-use service that, in real time over the Internet, extends IT's existing capabilities. Cloud computing is at an early stage, with a motley crew of providers large and small delivering a slew of cloud-based services, from full-blown applications to storage services to spam filtering. Yes, utility...