Home > DeveloperSection > Articles > SFDC: Creating a New Object

SFDC: Creating a New Object

Sales Force Cloud Computing  Cloud  SFDC 
0 Comment(s)
 1050  View(s)
Rate this:

SFDC:  Creating a New Object


In my last post SFDC: Add field to an Object , we added fields in our merchandise object. Now here we see how to add new object in our app.

To make the Warehouse app more realistic, we need invoices to track orders going in and out of the warehouse. Here, we learn how to extend the app further by:

        Creating another custom object, for keeping track of invoices. This object needs a Status field to track whether the invoice is open, closed, or somewhere in-between.

        Adding a tab to the app so users can work with invoices.

        Reordering tabs for easier navigation.


Create the Invoice Object Using the Wizard

An invoice is required to move inventory into or out of the warehouse. In this step, we create an invoice object that allows us to create multiple invoice statements, each with a unique number, status, and description.

1.       Return to Setup, and click Create > Objects.

2.       Click New Custom Object.

3.       Fill in the custom object definition.

§  In the Label field, type Invoice.

§  In the Plural Label field, type Invoices.

§  Select Starts with vowel sound.

§  In the Record Name field, type Invoice Number (replace Name with Number).

§  For Data Type, select Auto Number.

§  In the Display Format field, type INV–{0000}. (Note there are no spaces.)

§  In the Starting Number field, type 0.

        In the Optional Features section, select Allow Reports (in case you create reports later).

4.       Select Launch New Custom Tab Wizard after saving this custom object.

5.       Click Save.



Add an Invoice Tab to the App

When you click the Merchandise tab, a list of Merchandise records appears. Similarly, you need to create a tab that displays Invoices.

1.       Because you selected Launch New Custom Tab Wizard... in the previous step, you should now be looking at that wizard (if you’re not, click Setup > Create > Tabs, and then click New in the Custom Object Tabs section). Choose your Invoice object.

2.       In the Tab Style lookup, choose Form and click Next and then Next again.

3.       It makes sense to display this new tab for the Warehouse app. On the Add to Custom Apps page, clear the checkbox next to all apps except Warehouse.

4.       Click Save.




Reorder Tabs in app:

Take a look at the tabs across the top of your screen and you see the new Merchandise tab isn’t next to the Invoice tab. You can put tabs in any order you like, so go ahead and put them next to each other.

1.       The Setup menu on the left should already be open, so click Create > Apps and click Edit next to your Warehouse app.

2.       In the Selected Tabs list, select Invoices and use the up arrow to move it under Merchandise.

3.       Click Save and then take a look at the tabs.