Thursday, September 27, 2012

Setting up Relationships with other objects in Force.com

Relationship defines how different objects are associated or linked to each other. In Force.com platform, you set up relationships by creating custom relationship fields on an object. While adding new fields to the object, you select the appropriate data type. Master-Detail relationship or Lookup relationship.

Master-Detail Relationship


This type of field creates a parent-child relationship between objects. This relationship field serves in allowing us to achieve many-to-one and many-to-many relationship between objects.

When you are adding a custom field of this type on an object, the object you are adding the field to works as child object. The other object that you select as 'Related To' is the parent. Hence you are creating many-to-one relationship. The child object record's ownership, sharing and security is determined by the parent object record's setting. In fact, the child object doesn't have a owner field. In other words, the child records are owned by the owner of the parent record and also when the parent record is deleted all its child records are deleted as well.

Many-to-Many relationship can also be achieved using the same relationship field. But we need to understand where this field resides. To achieve many-to-many relationship between  two objects we create a custom object called junction object. This junction object is basically like intersection table between two tables in RDBMS. We create two master-detail relationship fields in the junction object to link with the objects for which we want to create many-to-many relationship.


Lookup Relationship


This type of field creates relationship between two objects in a simple form. Using this you can even link an object with itself. Unlike master-detail relationship, this one is loosely coupled and no cascading deletion. In other words, deletion of records in any object has no effect on the other linked object records. The ownership is maintained independently as well.

So, that is how the relationships between the objects are achieved. Go ahead and try out some.

Happy cloud computing using Salesforce!



Monday, September 17, 2012

Add new custom object in Force.com

In one of our previous articles we added new fields to an object. Now let us see how to add a new object. Objects in Force.com platform translate to a database table. New objects are called custom objects.

New object can be added in Force.com platform under App Setup -> Create -> Objects.  Clicking on 'New Custom Object' button on this page takes you to a page where you can enter your new object name and create the custom object. It allows you to enter name and type for 'Record Name' field as well which is a unique identifier for the record. You can set this to auto generate a number in a specific format as well as shown below.



After you create the object, you can setup user access either using Permission Sets or updating the Profiles under Administration Setup -> Manage Users. Look for 'Object Settings' while editing Permission Sets or look for 'Custom Object Permissions' while editing Profiles.

Our new custom object is ready with the standard fields and waiting for all the new custom fields. Go ahead and get working on them as per our article.

Happy cloud computing using Salesforce!

Wednesday, September 12, 2012

What is a Profile in Force.com?

A profile in the Force.com application can be called as a container that has access rights information of users. When a user is logged into the application, what is displayed including data and user interface is determined by the profile the user belongs to. A user always belongs to a profile and can belong to only one profile at a given time.

A profile can be directly related to the job function of the user. For example, in a given organization, System Administrators have similar duties on the job - need access to the same set of data and pages. Hence you can define a profile with required access for System Administrators and assign that profile to all the System Administrators.


Profiles define object and field permissions, tabs and pages the user can see, code the user can execute,  functions the user can perform and many other user permission parameters.


When we are trying to understand user access permissions, we need to understand couple of other related terms as well. Role and Permission Sets.


While profiles control object and field level access, a role controls record level access. Role defines different levels of users by way of hierarchy. Each role in the hierarchy represents a level of data access. A user with a given role will have access to the data of all the users who fall below in the hierarchy in terms of role assignment. Hence higher the role in the hierarchy, higher the level of data access. Typically you would assign one profile and one role to each user.


Permission sets also define user access parameters like profiles. All those access rights that you can define using the profiles can be defined using permission sets. But permission sets are used little differently than profiles. They extend the access rights the user profile has already defined. Thus if you were to give some additional access to a user, permission set is the one you need to use. For example - say there are 100 users in one profile. For a certain period 5 users among them need some extra user access to certain objects. All you do is define and assign a permission set to those 5 users without changing the profile. When this additional access is not in need, just remove the permission set that was assigned. Also, while users can have only one profile, they can have multiple permission sets.


Profiles, Roles and Permission Sets can be managed in Force.com platform under Administration Setup -> Manage Users. 

Happy cloud computing using Salesforce!

Monday, September 10, 2012

Add new custom fields to object in Force.com

As part of our previous article, we added a simple application and a custom object was automatically created for us.  Now let us explore the platform's each feature at a time as part of our application customization.

Obviously we need to add more fields to our custom object that was automatically created. To begin with let us see what is in there in that object.

Under App Setup (look in Left Sidebar), expand Create and click on Objects. This will list your Custom Objects and clicking on the object label will display the page where you can see the current definition of the object. As we can see our new object that was automatically created has some standard fields.


To add new fields, look for the area called 'Custom Fields and Relationships' which is right below the 'Standard Fields' section.


The 'New' button here will allow for adding new fields to the object. Adding a new field is a 4 step process.

Step 1. Choose the field Type


In this step you can select the type of field you want to create. For example - Text, Date, Number, etc. There is a list of fields displayed for your selection and the helper text next to it is clearly self-explanatory.


Step 2. Enter the Details 


Here you provide the details of the field like name, helper text, required yes/no, default value etc.


Step 3. Establish field-level security


List of profiles is displayed here and you can assign the visibility of this field to each profile. You can also assign which profile has edit access. Let us explore 'Profile' in the future articles. For now think of a profile as a container of user permissions.


Step 4. Add to page layouts


Indicate on which page this field should be displayed for user interaction. If you are at the very beginning stage like me, there will not be too many page layouts displayed for selection. But it is possible to have many page layouts based on an object and when you add a new field, you can specify which page should include it. The appropriate user interface is added to the field automatically. For example - if it is a Date field, a date pickup calendar is displayed for you in the page layout where the field is displayed.

That was the last step in adding a new field, hit 'Save' and your new field is added. You will see them listed under 'Custom Fields & Relationships' section. Also, check out the pages on which you selected it to be included.

Few clicks while following few steps and we have our new fields added. As simple as that!

Happy cloud computing using Salesforce!

Friday, September 7, 2012

Get started with Force.com

So far we got the theory in place. We learnt the difference between SalesForce.com and Force.com, got introduced to different parts of the Force.com platform and learnt the architecture behind the Platform. And I suppose you got your free Developer Edition Account of the platform. It is time to "see and feel" the powerful Platform!

Go to http://developer.force.com/, click on DE Login and continue with your credentials. You are taken to a page where you will see many different menus and links. We are not going through all of them at once in this article. Let us just see how to get started with an application to get the feel of developing in the Force.com Platform.

If you have just logged in and haven't clicked around too much, you should be seeing the following section in the page displayed. If that is not where you are, click on your name (top right corner) and select Setup from the drop-down menu.


To create an application, the first step you do is click on the 'Add App' button. The following window pops up ready for us to fill in App Name and Label.

As my learning exercise I will be creating and experimenting with variety of applications. I will not go deep into those applications as such. My articles will be mainly covering the platform features in detail, not my applications. Hence to experiment anything you read in my blog articles, you will need to come up with your own application.

Clicking on 'Create' button added my application called Worksheet Homework and also added a custom object called Worksheet. The platform also added a tab at the top called 'Worksheets' for easy access.

As you can see, just a click or two, I have my application up and running in very simple form. Much more needs to be done to get this application really functional but as a getting started step, wasn't it quick and easy?

Let us see all other features of the Force.com platform in our future articles.

Happy cloud computing using Salesforce!

Thursday, September 6, 2012

Force.com Platform Architecture

The powerful Force.com development platform has two unique technologies making a big impact on the functionality of the platform. Multi-tenant Architecture and Metadata-driven development model. Before going further, it is important to learn and understand these two technologies.


Multi-tenant Architecture


Multi-tenancy is an architecture in which a single instance of an application sharing common infrastructure and code base serves multiple users (tenants).  Force.com platform allows developing multi-tenant applications. Users share the same instance and version of the application and all other resources. All users are running on the same code, same database schema, same hardware and operating system. Force.com platform users are given the ability to customize the application and data model. Each user's customization on top of the core application stays as a separate abstract and invisible to other users. Similarly, though the database is shared among users, their data is not seen by each other.


Metadata-driven Development Model


The Force.com platform uses a metadata-driven development model. In this model of development, the functionality of the application, how it looks and functions, is defined as metadata and stored in a database. That is, the application you build in the Force.com platform is not using any programming language. Instead, the "source code" for the application is considered as data and stored in the database. This includes everything - user interface, business logic, process automation rules, any custom code, data model configuration and anything and everything related to your application. When the application is accessed by the end user, the application is rendered simply by reading the metadata.

The application development using the platform's point and click method of development results into metadata. The platform also exposes metadata API to allow for programmatically managing the application. The API allows you to create and modify metadata components.

More exploring in future articles.

Happy cloud computing using Salesforce!

Tuesday, September 4, 2012

Introduction to Force.com Platform

In our previous article we learnt that Force.com is a platform for developers offered by Salesforce.com for building and running business applications in their cloud. Now let us read in bit more detail to learn what all exactly you can do using the platform.

All businesses, big or small, have variety of requirements to keep track of information, pass it on to different departments for approvals,  query and run report on it, etc, etc. There is no single off-the-shelf platform that can accommodate everyone's unique requirement. Force.com platform attempts to give an easy solution for this common business problem. The platform allows an easy way to quickly create powerful applications, all from your browser, to meet your business application needs. 

The Force.com platform offers a simple point and click method of building applications. The various parts of the platform can be summarized as below -


Data Storage


Force.com platform provides Standard Objects such as Account, Contact, and User. Platform allows you to customize these objects as well as create new custom objects. These objects, either standard or custom, are the components that model the data you need to store in your application. Though they are very closely matching to the Relational Database Table definitions, defining them is way simple here. You are not writing any SQL to create them. You simply point and click in the platform to create or customize the objects.

Data Security


Platform allows you to easily define security sharing rules for the data. 1. Object Level Security - You can define object permissions to prevent a user from reading, creating or editing an instance of a particular type of object. 2. Field Level Security - You can define access so that a user is prevented from reading, creating or editing the value for a particular field of an object. 3. Record Level Security - You can also define access on the individual records. You may provide object level access but restrict access on certain records in it.


User Interface


Force.com automatically generates user interface based on the object definitions. Generates very sophisticated pages including variety of field controls. Page layout editor allows you to customize these pages further. If this fastest and easiest point and click method is not enough to meet your needs you can build your own pages from scratch. 


Process Automation


The point and click workflow and approval engine allows you to define rules to perform actions automatically when certain changes occur.  Platform can send out emails, assign tasks, update field values. Platform can also send messages to other applications in the cloud.  


Reports


Force.com platform allows you to generate 3 different types of report - Tabular, Summary, Matrix. Report is generated using the real time data and can include filters, groupings and customized graphs. 

As we can see these are quite a set of features giving ability to build a powerful, robust and secure business application. And the thing is one can quickly put together all of these just by point and click method. 

We will be exploring all of these features further in depth in our future articles.

Happy cloud computing using Salesforce!

Monday, September 3, 2012

What is Salesforce.com? And what is Force.com?

Salesforce.com is a Software Company that provides customizable business software on a subscription basis. They provide Software as a Service (SaaS) in the cloud platform. With this, businesses can eliminate all the complications surrounding hardware, software and all related IT resources. Businesses subscribe and pay for the service they need and Salesforce.com takes care of managing hardware and software. In other words, it is an Internet based service. You sign up and access your software through a browser. Nothing to install, no hardware to buy. But it is a shared platform with each business having their own "space" in the cloud. 

Salesforce business suites provided by the company, Salesforce.com, is a customer relationship management (CRM) tool providing the Sales, Service and Marketing applications. These are pre-built applications with all the pre-built data model, business logic and user interface. However, the application running in your space is yours. You can customize and enhance to meet your specific business needs.

And now to our second question - what is Force.com?

We just read that the Salesforce CRM applications can be customized. The platform that allows you to customize the predefined functionalities of these applications is called Force.com.   Force.com is the underlying platform that includes the data model, business logic and user interface using which your Salesforce application is built. By this development platform, you have access to all these pieces of your application. 

However, Force.com platform is not for just customizing Salesforce.com  pre-built applications. This platform allows developers to create any kind of business applications and host it on Salesforce cloud platform as a service. You can design your own data model, apply business logic, create user interface, generate reports and queries based of your data, all using the Force.com platform.

Force.com development platform itself a cloud computing platform. You will access it using the browser via Internet for all your development needs.  Salesforce.com provides a free Developer Edition account. It is a fully functional version of Force.com. You can obtain yours at http://developer.force.com.

We will be looking at the Force.com platform in much more detail in the future articles.

Happy cloud computing using Salesforce!