Showing posts with label Salesforce. Show all posts
Showing posts with label Salesforce. Show all posts

Tuesday, July 26, 2011

Preventing focus of first input field and Calendar widget on page load in Salesforce

Sometimes in salesforce visualforce pages, the first input field on the page will automatically be set to focus on page load. This can be very annoying and confusing to a user, sometimes scrolling the page to the far right, halfway down the page, or opening up the calendar widget over your other content by default. This post is first showing how to remove focus from either a input field or the calendar widget, and second showing how easily replicate the Salesforce calendar widget(not a permanent solution as class names and javascript libraries could change at any point in time).

First to remove focus from a normal input field, you can put in a extra input with a type of hidden, and give it a Id. Then write a short bit of javascript to call that hidden field and set focus to it on page load.

see code below

Sunday, June 26, 2011

Visualforce actionStatus Component using the salesforce animated gif

In this post I will show a example of how to use salesforces animated gif and the visualforce actionStatus component to represent a loading screen to the user. This can be very beneficial if you have a tab panel to switch in between tabs, or if you are rerendering a pageBlockTable etc.. This visual stimulation is much more appealing than a blank white screen or just a static screen that is populating asynchronously, which could confuse or frustrate a user into clicking off the screen.


Here is the markup

Monday, May 2, 2011

Keyword Action Chatter Trigger – Keyword in chatter used to update/change records

This is a practice demo for the new chatter triggers, working from the released Spring '11
example. By typing the keyword  '!close'  on a Opportunity entity feed, it will automatically close the Opportunity. This could be a very usefull feature to quickly close an opp from a mobile phone on the mobile chatter app.


Here is the trigger code

Thursday, April 28, 2011

Visualforce component basic examples (more to come)

This is a collection of different basic visualforce components for getting started with developing in salesforce. Also a few examples of components that are similar to someone coming from a .NET background into salesforce developing. Hopefully eliminating wasted time searching all over for samples of these different controls.

Live demo available here.