gpt4 book ai didi

salesforce - 帮助/协助重构 force.com 代码库的工具(重命名自定义对象)

转载 作者:行者123 更新时间:2023-12-04 06:28:47 25 4
gpt4 key购买 nike

我们需要在 force.com 中重命名大约 15 个自定义对象。

在 Java 中,这将是一次右键单击和大约 20 分钟的工作,但考虑到使用这些对象的 soql 查询、类、页面、配置文件等的数量,我们预计需要一周、两周……或更长时间。

因此,理想情况下,我们正在寻找一种重构工具,它将帮助我们重命名此对象并解决任何相互依赖关系。

Force.com IDE 自然不支持这个。任何想法/工具/方法?

最佳答案

我们用两个物体做到了这一点,这是一种皇家痛苦,我可以想象 15 构成了相当大的挑战。正如您现在注意到的,salesforce 结构与交叉高度相互依赖,甚至循环引用也是合法的。另一方面,这使得拆卸和核心修改非常困难,几乎不可能自动化。

您可以执行以下操作:

  1. Use sandbox for modifications, do an inventory of all constructs using affected objects. You can use Ctrl-H to search the entire workspace in IDE
  2. On sandbox, clone those 15 objects into their respective future names, they'll be empty but who cares on sandbox.
  3. Now that you have objects in place, rename all mentions in all constructs from #1 to use new objects
  4. Just to make sure try to delete old objects from sandbox, this will serve as a sanity check that you didn't miss any dependency.
  5. Off work hours delete the entire inventory of #1 from production server, leaving just bare objects with their data
  6. Now that the dependencies are gone, rename all 15 objects
  7. In one session deploy the entire modified inventory from sandbox to production, since the payload now uses new object names the tests should pass.


我不认为你应该花一天以上的时间来完成这一切。

关于salesforce - 帮助/协助重构 force.com 代码库的工具(重命名自定义对象),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5702567/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com