apex開發指導--創建沙盒環境

創建沙盒環境

學習目的:
1,salesforce有幾個環境
2,爲什麼要這些環境
3,怎麼製造環境

salesforce有幾個環境

Production org—生產環境是真實用戶直接訪問和使用的環境,不能直接在裏面修改代碼
Developer org—開發環境用於開發人員的開發和簡單的測試
Sandbox org—沙盒環境用於模擬生產環境去做上線前的測試,一般也叫UAT環境

爲什麼要這些環境

1,生產環境一般會由公司的IT部門或者管理員掌控,不會給服務方開放,這是因爲上面的數據都是真實數據,有機密性。生產環境的使用對象是真實用戶,所以上面部署的代碼和做的config都是最嚴格,正確的
2,開發環境是爲了給開發人員提供一個開發需要的簡單基礎數據。開發過程是一個試錯過程,所以這個環境不會對外開放,都是IT或者系統管理人會使用
3,沙盒環境是爲了上生產做的最後一道檢驗,上面的數據基本都是從生產賦值過來的,所以可以到達最逼真的模擬使用。而且在部署到生產的時候必須對代碼的單元測試覆蓋率達到75%+,不然不允許部署

一般使用過程是,現在開發環境開發,進入uat階段就上沙盒環境,然後通過uat就部署生產。生產遇到問題,那麼久先到開發環境去做修改,然後部署到uat,再上生產,這樣做的好處能夠不會讓各環境版本不一致。無論是給開發還是業務人員,都帶來對版本的管理和控制的好處。

怎麼製造環境

在這裏插入圖片描述
To create a sandbox org:

1,From Setup, enter Sandboxes in the Quick Find box, then select Sandboxes.
Click New Sandbox.
2,Enter a name (10 characters or fewer) and description for the sandbox.
We recommend that you choose a name that:
Reflects the purpose of this sandbox, such as QA.
Has only a few characters, because Salesforce appends the sandbox name to usernames on user records in the sandbox environment. Names with fewer characters make sandbox logins easier to type.
3,Select the type of sandbox you want.
If you don’t see a sandbox option or need licenses for more, contact Salesforce to order sandboxes for your org.
4,If you reduce the number of sandboxes you purchase, you are required to match the number of your sandboxes to the number you purchased. For example, if you have two Full sandboxes but purchased only one, you can’t create a Full sandbox. Instead, convert a Full sandbox to a smaller one, such as a Developer Pro or Developer sandbox, depending on which types you have available.
5,Select the data to include in your Partial Copy or Full sandbox.
For a Partial Copy sandbox, click Next, and then select the template you created to specify the data for your sandbox. If you have not created a template for this Partial Copy sandbox, see Create or Edit Sandbox Templates.
For a Full sandbox click Next, and then decide how much data to include.
To include template-based data for a Full sandbox, select an existing sandbox template. For more information, see Create or Edit Sandbox Templates
To include all data in a Full sandbox, choose whether and how much field tracking history data to include, and whether to copy Chatter data. You can copy from 0 to 180 days of history, in 30-day increments. The default is 0 days. Chatter data includes feeds, messages, and discovery topics. Decreasing the amount of data you copy can significantly speed sandbox copy time.
To run scripts after each create and refresh for this sandbox, specify the Apex class you previously created from the SandboxPostCopy interface.
Click Create.

這個是官方文檔裏面的創建步驟。連接是apex開發文檔

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章