在 Dynamics AX 中管理不同的项目配置

发布于 2024-10-04 04:02:08 字数 978 浏览 4 评论 0原文

我们很难区分不同的配置。请允许我用一个小

场景来解释:

假设您有两个 AX 项目,例如 PM,它们都更改了 ProdRouteJob 表,调用他们自己的项目特定类之一中的方法。
当然,您的开发人员机器上有所有这些类,并且 ProdRouteJob 编译得很好,但是对于在新服务器上安装,您不希望为每个未安装的项目添加存根类,你?因此,您可以将这些对项目类的调用包装在类似

if( Global::isConfigurationkeyEnabled( <projectPConfKey> ) )  
     // call project P stuff

干净地封装它们的内容中。您为所有项目声明了配置密钥,然后就可以开始了,对吗?

但是,如果您尚未在此计算机上安装项目 P,则会引发错误,因为其 projectPConfKey 未知。现在,您可以在每次安装时为所有项目安装配置密钥,只是为了告诉服务器存在 projectPConfKey 这样的东西,但是所有这些 if 都会评估为 true...

简而言之:如何在项目 XPO 中包含配置键以便您的代码可以编译,但同时从一开始就禁用某些配置键?

或者我在这里缺少一些完全基本的东西?

编辑:

答案中的共识(谢谢您,demas;谢谢您,Kjeldsen 先生)是,尝试通过宏或配置键或多或少自动进行客户端配置是不切实际的。因此,当我们在客户端安装时,我们必须导入包含更改的标准表,并手动取出与当前安装无关的所有更改。

我有点不知该接受哪个答案,因为 demas 回答了我提出的问题,而 Kjeldsen 先生则回答了 demas 回答下评论对话中出现的问题。我将向 Kjeldsen 先生致歉,将 demas 的回答标记为已接受。

We have trouble with keeping apart our different configurations. Allow me to explain with a little

Scenario:

Let's say you have two AX projects, e.g. P and M, that both alter the ProdRouteJob table, calling methods in one of their own project specific classes.
You have all these classes on your developer machine, of course, and ProdRouteJob compiles fine, but for an installation on a new server, you don't want to add stub classes for every non-installed project, do you? So you wrap these calls to project classes in something like

if( Global::isConfigurationkeyEnabled( <projectPConfKey> ) )  
     // call project P stuff

to encapsulate them cleanly. You declare configuration keys for all your projects, and you're ready to go, right?

However, this throws an error if you haven't installed project P on this machine, because its projectPConfKey is unknown. Now you could at every installation install configuration keys for all your projects, just to tell the server that there is such a thing as a projectPConfKey, but then all these ifs would evaluate to true...

In short: how do you include configuration keys in your project XPOs so that your code compiles, but at the same time so that some configuration keys are disabled from the start?

Or is there something totally basic that I'm missing here?

EDIT:

Consensus among the answers (thank you, demas; thank you, Mr. Kjeldsen) is that it's impractical to attempt a more or less automatic client-side configuration via macros or configuration keys. Thus, when we are installing at the client, we will have to import the standard tables with our changes and manually take out all changes not pertinent to the current installation.

I am a bit at a loss which answer to accept, because demas answered the question I asked, while Mr. Kjeldsen answered the questions that arose in the comment conversation under demas' answer. I shall, with apologies to Mr. Kjeldsen, mark demas' answer as accepted.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

风柔一江水 2024-10-11 04:02:08
if( Global::isConfigurationkeyEnabled( <projectPConfKey> ) ) 

此检查仅在执行时有效,当您编译代码时,您会收到错误。

因此,当您在生产服务器上导入对象并仅导入项目 M 的更改时,您需要创建存根类或比较对象。

还有另一种方法,但我没有 Axapta 来检查它。尝试:

#if.never
someMissingCall();
#endif

但我不确定它现在是否有效。

if( Global::isConfigurationkeyEnabled( <projectPConfKey> ) ) 

This check works only execution time and when you compile code you get the error.

So you need create stub classes or compare objects when you import them on production server and import only changes of project M.

There is another one approach but I don't have Axapta to check it. Try:

#if.never
someMissingCall();
#endif

But i'm not sure that it will works now.

呆橘 2024-10-11 04:02:08

大型解决方案中心 (VAR) 通常为每个模块提供单独的应用程序。
如果您有 2 个模块,则您有 2 个应用程序。

好的模块与标准应用程序的冲突区域非常小,这些都保存在单独的项目中。

然后在安装时手动处理与标准模块和其他模块的冲突。由于冲突区域很小并且很少发生变化(它不应该包含业务逻辑),因此问题很小。

Big solution centers (VAR) typically have separate applications for each module.
If you have 2 modules, you have 2 applications.

Good modules have very small collision areas to the standard application, these are kept in a separate project.

Collisions with the standard and other modules are then handled manually at install time. As the collision area is small and rarely change (it should not contain buisness logic) the problem is minimal.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文