這篇文章給大家介紹Salesforce中DX學(xué)習(xí)的示例分析,內(nèi)容非常詳細(xì),感興趣的小伙伴們可以參考借鑒,希望對(duì)大家能有所幫助。
公司主營(yíng)業(yè)務(wù):網(wǎng)站設(shè)計(jì)、成都做網(wǎng)站、移動(dòng)網(wǎng)站開發(fā)等業(yè)務(wù)。幫助企業(yè)客戶真正實(shí)現(xiàn)互聯(lián)網(wǎng)宣傳,提高企業(yè)的競(jìng)爭(zhēng)能力。創(chuàng)新互聯(lián)建站是一支青春激揚(yáng)、勤奮敬業(yè)、活力青春激揚(yáng)、勤奮敬業(yè)、活力澎湃、和諧高效的團(tuán)隊(duì)。公司秉承以“開放、自由、嚴(yán)謹(jǐn)、自律”為核心的企業(yè)文化,感謝他們對(duì)我們的高要求,感謝他們從不同領(lǐng)域給我們帶來的挑戰(zhàn),讓我們激情的團(tuán)隊(duì)有機(jī)會(huì)用頭腦與智慧不斷的給客戶帶來驚喜。創(chuàng)新互聯(lián)建站推出天峻免費(fèi)做網(wǎng)站回饋大家。
登錄到開發(fā)中心 sfdx force:auth:web:login -d -a DevHub
-a 創(chuàng)建別名 -d 設(shè)置為默認(rèn)組織
創(chuàng)建文件夾 mkdir folderName
cd folderName
clonegit clone https://github.com/dreamhouseapp/dreamhouse-sfdx.git
刪除scratchsfdx force:org:delete
一個(gè)scratch 配置
{ "orgName": "Dreamhouse", "edition": "Developer", "hasSampleData": "false", "settings": { "orgPreferenceSettings": { "s1DesktopEnabled": true, "selfSetPasswordInApi": true, "s1EncryptedStoragePref2": false } } }
創(chuàng)建Scratch Org 并設(shè)置為默認(rèn) sfdx force:org:create -s -f config/project-scratch-def.json -a dreamhouse-org
打開指定org sfdx force:org:open -u xxx
將元數(shù)據(jù)推送到Scratch sfdx force:source:push
分配權(quán)限 sfdx force:user:permset:assign -n xxxx
導(dǎo)入樣本數(shù)據(jù) sfdx force:data:tree:import --plan data/sample-data-plan.json
需要在sfdx中設(shè)置DevHub為默認(rèn),同時(shí)需要開啟package
sfdx force:package:create --name dreamhouse --description "My Package" --packagetype Unlocked --path force-app --nonamespace --targetdevhubusername DevHub
--name is the package name. This name is an alias you can use when running subsequent packaging commands.
--path is the directory that contains the contents of the package.
--packagetype indicates which kind of package you’re creating, in this case, unlocked.
創(chuàng)建版本: sfdx force:package:version:create -p dreamhouse -d force-app -k test1234 --wait 10 -v DevHub
-p is the package alias that maps to the package ID.
-d is the directory that contains the contents of the package.
-k is the installation key that protects your package from being installed by unauthorized individuals.
轉(zhuǎn)換成正式版本:sfdx force:package:version:promote -p dreamhouse@1.0.0-1 -v DevHub
安裝到Org中:sfdx force:package:install --wait 10 --publishwait 10 --package dreamhouse@1.0.0-1 -k test1234 -r -u MyScratchOrg
關(guān)于Salesforce中DX學(xué)習(xí)的示例分析就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,可以學(xué)到更多知識(shí)。如果覺得文章不錯(cuò),可以把它分享出去讓更多的人看到。