建立自訂挑選清單Create custom picklists

除了內建的挑選清單之外,您現在可以自行建立挑選清單。It's now possible to create your own picklists, in addition to the ones that are available out-of-the-box. 「挑選清單」是一簡單概念,基本上便是包含名稱與描述的具名項目清單。Picklists, which are basically a named list of items that include a name and descriptions, are a simple concept. 挑選清單欄位經轉譯之後,便會顯示包含項目顯示名稱的下拉式功能表。When the picklist fields are rendered, a drop-down menu that contains the display names of the items will appear.

挑選清單是使用位於 [Common Data Service] 索引標籤上,[實體] 功能表下方的 [挑選清單] 功能表項目來新增。Picklists are added by using the menu item, Picklists on the Common Data Service tab, under the Entities menu. 按一下功能表來檢視目前在環境中定義的所有挑選清單。Click the menu to view all of the picklists that are currently defined in your environment. 其中已為您定義了幾個常用的挑選清單,您可以透過它們的類型 ([標準]) 來輕鬆識別它們。Several commonly used picklists are already defined for you and can easily be identified by their type, Standard. 您自行建立之挑選清單的類型將會是 [自訂]。The ones that you create for yourself are the type Custom.

  1. 若要建立新的挑選清單,請按一下頁面頂端的 [新增挑選清單]。To create a new picklist, at the top of the page, click New Picklist. 在開啟的頁面上,輸入名稱、顯示名稱和描述來定義您的挑選清單。On the page that opens, define your picklist by entering the name, display name, and a description. 重要:建立挑選清單之後就不能變更挑選清單名稱。Important: The picklist name can't be changed after you create the picklist. 挑選清單名稱有幾個要求。There are a few requirements for the picklist name. 名稱必須簡單且不包含任何特殊字元。The name must be simple and can't contain any special characters. 此外,一個特定的名稱只能用於一個挑選清單。Also, you can only have one picklist with a particular name. 如果嘗試使用相同名稱建立另一個挑選清單,您會收到錯誤訊息。If you try to create another picklist with the same name, you will receive an error. 這些限制不適用於「顯示名稱」。These restrictions don't apply to the Display name.

    在本主題中,我們會建立可用來選擇運輸模式的挑選清單。In this topic, we will create a picklist that can be used to choose a mode of transportation.

  2. 將挑選清單命名為 Transportation,並將資訊新增到必要的欄位。Name the picklist Transportation and add the information to the required fields.
  3. 按一下 [下一步],然後在下一頁提供挑選清單的各種元素,在此範例中為運輸提供者。Click Next, and on the next page provide the different elements of the picklist, for this example, the transportation providers. 當頁面開啟時,您會看到已建立的單一項目。When the page opens, you will see that a single item is already created. 以適合您所建立之挑選清單的資訊來更新該行項目。Update the line item with information appropriate to the picklist that you are creating. 編輯是在行內進行。Editing is done in the line. 挑選清單項目沒有個別的頁面。There is not a separate page for each picklist item. 按一下 [NewItem] 欄位以新增第一個項目。Click in the NewItem field to add the first item. 當您需要新的挑選清單元素時,請按一下畫面右上方的 [新增項目] 來新增新的一列。Any time that you need a new picklist element, click Add item at the top right of the screen to add a new row.

按一下位於項目行最右邊的垃圾桶圖示來刪除該項目。You can delete an item by clicking the garbage can icon on the far right of each item line. 新增所有需要的項目之後,按一下 [建立] 來建立清單,並將它提交到伺服器。When all of the required items have been added, click Create to create the list and submit it to the server. 該挑選清單將會新增到現有挑選清單的清單上。You will see the picklist added to the list of existing picklists.

您現在可以使用該挑選清單來定義實體上的欄位,方法是新增 [挑選清單] 欄位類型,然後使用該欄位 [屬性] 窗格中的 [顯示名稱]。You can now use the picklist to define fields on your entities by adding a field type Picklist, and then using the Display name in the Properties pane for the field.