development


27
Jul 09

Force.com platform as a service

For the last 4-5 months i’ve been working with the force.com platform, more specifically with the on-demand CRM salesforce.com. In these few months working in this platform, i’ve seen some major improvements that i think will establish force.com as a major platform for the development of web applications, among these: Visualforce, Web-services (which have been around for some time), integration with Google and APIs provided for other frameworks such as Adobe Flex/Air.

This platform as a service concept is new for me and I think it offers great advantages in matters of development & deployment time,acquisition and maintenance costs of hardware & software. And now, with Visualforce, it gives developers the ability to follow the Model-View-Controller Design Pattern in order to have data models, business logic and user interface in different layers.

I’ll post more information about how to work on each of these layers and maybe show some code of examples that i come to write in this platform.

For more info, check out salesforce.com


23
Apr 09

Autocomplete component

Hello everyone, just wanted to share with the community this custom component I made and give something back for the help I’ve received :)

The purpose of the component is to enable autocomplete in lookup fields. I used the autocomplete js created by Jim Roos:
(http://www.jimroos.com/2007/05/ajax-autocomplete.html) but made some modifications to it so that it could interact with an Apex controller among some other things…

So my idea was that if you were making a VF page that had an inputfield that was related to a lookupfield you would just insert this autocomplete component to that inputfield.

Something like this:

<apex:inputField value=”{!Contact.accountid}” id=”accname” styleClass=”cField”>

<c:autocomplete ObjectName=”Accounts” InputId=”{!$Component.accname}”

AutoCompleteId=”accACid” ClassName=”autocomplete300″/>

</apex:inputField>

The component has 4 parameters:

The name of the object or custom object that the inputfield relates to (new objects must be added inside the apex classes since i had some problems constructing a dynamic query).
The InputId which is used to relate the component to the input field
The id for the Component
A classname parameter that basically just defines the width of the suggestions menu.

Here’s a screenshot of how it looks like in action:


Here’s a link to the file containing the required files:

AutoCompleteComponent