articles

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

SFDC: Creating a New Object

Anonymous User5170 04-Mar-2015

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 Labelfield, 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.

 

SFDC: Creating a New Object

 

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.

 

SFDC: Creating a New Object

 

SFDC: Creating a New Object

 

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.

 

SFDC: Creating a New Object

 

Add a Status Field to the Invoice Object

If you try to create an invoice now, you won’t be impressed. There aren’t any fields that you can modify because they are all standard, auto-managed fields. In this step, you extend the Invoice object to add a new Status picklist field to track the status of each invoice.

1.       In the Setup area, click Create > Objects and then click Invoice.

2.       Scroll down to the Custom Fields & Relationships related list and click New.

3.       For Data Type, select Picklistand click Next.

4.       Fill in the custom field details.

a.       Field Label: Status

b.      Type the following picklistvalues in the box provided, with each entry on its own line.

1.       Open

2.       Closed

3.       Negotiating

4.       Pending

c.       Select Use first value as default value.

d.      In the Help Text field, type Choose a value from the drop-down list.

5.       Leave the defaults for the remaining fields and click Next, Next, and Save.

 

SFDC: Creating a New Object

 

Add Records to Invoice Object:

1.       Click the Invoices tab.

2.       Click New. Notice that you can choose a status for the invoice, but leave it as Open.

3.       Click Save.

4.   Click the Invoices tab again and notice there’s a new invoice, with the number INV-0000. Create another new invoice, this time with a Closed status.

5.   Click the Invoices tab again and see your two invoices.

SFDC: Creating a New Object

 

**This document is referred from salesforce help tutorials

 


Updated 07-Sep-2019
I am a content writter !

Leave Comment

Comments

Liked By