温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Salesforce中DX​学习的示例分析

发布时间:2021-09-10 10:25:30 来源:亿速云 阅读:103 作者:柒染 栏目:大数据

这篇文章给大家介绍Salesforce中DX学习的示例分析,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。

Salesforce DX 学习

  1. 登录到开发中心 sfdx force:auth:web:login -d -a DevHub -a 创建别名 -d 设置为默认组织

  2. 创建文件夹 mkdir folderName cd folderName

  3. clone
    git clone https://github.com/dreamhouseapp/dreamhouse-sfdx.git

  4. 删除scratch
    sfdx force:org:delete

  5. 一个scratch 配置

     {
       "orgName": "Dreamhouse",
       "edition": "Developer",
       "hasSampleData": "false",
       "settings": {
         "orgPreferenceSettings": {
           "s1DesktopEnabled": true,
           "selfSetPasswordInApi": true,
           "s1EncryptedStoragePref2": false
         }
       }
     }


  6. 创建Scratch Org 并设置为默认 sfdx force:org:create -s -f config/project-scratch-def.json -a dreamhouse-org

  7. 打开指定org sfdx force:org:open -u xxx

  8. 将元数据推送到Scratch sfdx force:source:push

  9. 分配权限 sfdx force:user:permset:assign -n xxxx

  10. 导入样本数据 sfdx force:data:tree:import --plan data/sample-data-plan.json

创建一个包

需要在sfdx中设置DevHub为默认,同时需要开启package Salesforce中DX​学习的示例分析 Salesforce中DX​学习的示例分析

  1. 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.

  2. 创建版本: 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.

  3. 转换成正式版本:
    sfdx force:package:version:promote -p dreamhouse@1.0.0-1 -v DevHub

  4. 安装到Org中:
    sfdx force:package:install --wait 10 --publishwait 10 --package dreamhouse@1.0.0-1 -k test1234 -r -u MyScratchOrg
    Salesforce中DX​学习的示例分析

关于Salesforce中DX学习的示例分析就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI