Salesforce 0 Basic Learning (20) Simple app creation

Source: Internet
Author: User

This article reference link: https://developer.salesforce.com/trailhead/project/salesforce_developer_workshop

This article is about the simplest app creation, covering the following points of knowledge:

Creation of 1.Object;

2.Tab and app creation;

3.Trigger creation;

4.Permission sets creation;

5.Validation Rules use;

6.Schedule job use;

7.Layouts creation/modification;

8.Test created.

I. Creating an Object

Here we use the goods table, which contains a number of custom fields, in order to facilitate learning, so many different types of operations, ignoring the specific business. The Product table information is as follows:

The Commodity table field information is as follows: Many of these fields are created for learning formula, and only one of the formula is shown here.

Two. tab and app creation

First you need to create a tab

1. Click Setup->build->create-tabs or Enter tabs click the tabs link in the Search box to enter the page;

2. Click the New button of the custom Object Tabs to create a custom tab.

3. In the Object drop-down box, locate the object that you want to create tab, choose Tab Style (do not know what to use), enter describe click Next;

4. Set which profile can see this tab;

5. Set which app can display this tab, click Save,tab to create the end.

Then create the app

1. Click Setup->build->create-apps, click on the Apps link to enter the page;

2. Click the New button in the apps and select the Custom app next;

3. Enter the label and name of the app and enter the description after next;

4. Select the app's logo and use the default Logo,next if not selected;

5. Select the tab that the app can use to select the tab you just created to the selected area;

6. Select the profile to see the app and click Save,app to create the success.

Three. Trigger Create

Trigger is automatically executed, can be used before and after the operation of data related operations, business logic is recommended to use the handler method, the business can be simple to use directly within the trigger to write code.

The detailed usage of trigger can be found in the 17th article: http://www.cnblogs.com/zero-zyq/p/5413731.html

Four. Permission sets Create

Permission sets can set permissions for certain people to access and manipulate certain pages, apex classes, and so on.

The detailed usage of Permission sets can be found in the 19th article: http://www.cnblogs.com/zero-zyq/p/5406352.html

Five. Validation rules creation

Validation rules is used to save the previous field validation of the operation, and if the checksum is unsuccessful, the save operation is not performed, and Validation rules is executed automatically and does not need to be called.

The detailed usage of Validation rules can be found in the 16th article: http://www.cnblogs.com/zero-zyq/p/5409209.html

Here is a simple example, such as commodity prices cannot be empty and must be greater than 0. Procedure:

1. Click Setup->build->create->object to find the Object you want to set and click Enter;

2. Drop down to find validation rules and click on the New button;

3. Enter rule name,description, and then enter the validation code at error Condition formula.

Note: If the write is true, the error Message below will be displayed, and there should be a write-down condition.

Six. Schedule Job

Schedule job can handle some batch tasks and send mails and so on regularly.

For schedule Job can refer to the fifth article: http://www.cnblogs.com/zero-zyq/p/5287343.html

Seven. Layouts Create/Modify

When you create a sobject, the system automatically creates a layout, the layout that you create may not meet the requirements in terms of layouts, and you need to modify the layout, you can modify the layout layouts by modifying the page Layouts, in the following steps:

1. Click Setup->build->create->objects to find the object that needs to be manipulated;

2. After finding the page Layouts, select the default page Layouts and click Edit;

3. The following two simple examples, the first to add a section, so that the detail and edit page fields more hierarchical, left menu selected field, the right side will show section and blank Space, drag sections to detail part, Add a section, and you can drag the related fields to the section, where blank space is used to add a space action. When you drag a section, a dialog box pops up to set sections, such as a column or two columns.

This section allows you to set up a number of actions that can be consulted on this page.

Eight. Test creation

The test code is very demanding in Salesforce as the key to whether the app will succeed. The test code has a number of requirements and limitations, such as code coverage of 75% and above, and all tests must be successful, using the System.debug method as part of the test, and so on.

Detailed test rules can be found in Https://help.salesforce.com/apex/HTViewHelpDoc?id=code_run_tests.htm&language=en_US

Test code example

1 @isTest2 Private classTestgoods {3 4     StaticTestMethodvoidTestinsertgoods () {5Goods__c Goods =NewGoods__c ();6Goods. Goodsname__c = ' Test Goods Name ';7Goods. Goodsprice__c = 200;8Goods. Goodscostprice__c = 100;9Goods. Goodsbrand__c = ' Huawei ';TenDatabase.saveresult result =Database.insert (goods); OneSystem.assert(Result.issuccess ()); A     } -}

Click on your name, select Developer Console to enter the console mode, select Test->new run-> need to run the test class, after the run Select Tests tab to see coverage and other information.

Summary: This article describes the simplest development of the app module, there is a wrong place to welcome correct, did not do the project of their own children's shoes can be expanded in this way, not limited to the above steps, there are questions welcome message.

Salesforce 0 Basic Learning (20) Simple app creation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.