由于时区和 SystemDateGet() 的使用而导致的发布日期问题
摘要
我们遇到了一个问题,systemDateGet() 函数返回 AOS 在确定发布日期时需要本地日期。
详细信息
我们在世界各地、国际日期变更线两侧均设有分支机构, 使用适当的时区设置连接到本地终端服务器的用户 对于用户的分支。
每个分支机构都与不同的公司关联,该公司已配置为 正确的时区。
我们运行一个 AOS,并为总部设置了时区设置。有 无法引入额外的 AOS。
SystemDateGet() 函数返回 AOS 日期,因为用户没有更改 他们的 Axapta 会话日期。
数据库中与过帐日期相关的许多系统字段都是基于日期的,并且 不基于 UTCDATETIME。
我们正在运行 AX2009 SP1 RU7。
- 内核版本5.0.1500.4570
- 应用版本 5.0.1500.4570
- 本地化版本:巴西、中国、日本、泰国、印度
我知道 SystemDateGet() 函数旨在返回 AOS 日期,除非 用户更改其会话日期,在这种情况下会返回该日期。
每个用户在其用户配置文件中都有适当的时区设置。
问题
问题的一个示例是当用户尝试发布涉及财务的日记时 交易,检查分类账期间是否处于开放状态。例如, 用户在英格兰,试图在当地时间 11 月 30 日下午 3:00 发布日记 时间,标准 Axapta 代码使用 systemDateGet() 函数来确定要使用的日期 在验证中(确定该期间是否开放)。在我们的例子中,AOS 基于 澳大利亚布里斯班和 systemDateGet() 函数返回 12 月 1 日 (当地时间12月1日凌晨1:00)。
该问题的另一个示例是在美国星期五过帐发票 AOS 所在的星期几是星期六。我们需要系统 记录当地日期。
问题
除了重写所有涉及systemDateGet()的系统代码之外,超过2000个实体,还有没有 任何其他可用于解决获取正确本地问题的选项 日期?
解决方案的局限性。
在上面给出的分类账期关闭的示例中,不可能从 业务惯例观点为月底前开启下期处理 已完成。
目前没有购买额外 AOS 的选项。
Summary
We are experiencing a problem where the systemDateGet() function is returning the
AOS wher the local date is required when determining the date for posting purposes.
Details
We have branches around the world, both sides of the international date line, with
users connecting to local terminal servers with the appropriate time zone settings
for the user's branch.Each branch is associated with a different company, which has been configured with
the correct time zone.We run a single AOS with the time zone setting set for the head office. There is
not an option to introduce additional AOS's.The SystemDateGet() function is returning the AOS date as the user is not changing
their Axapta session date.A number of system fields in the database related to posting dates are DATE based and
not UTCDATETIME based.We are running AX2009 SP1 RU7.
- Kernel version 5.0.1500.4570
- Application version 5.0.1500.4570
- Localization version: Brazil, China, Japan, Thailand, India
I am aware that the SystemDateGet() function was designed to return the AOS date unless
the user changes their session date in which case that date is returned.Each user has the appropriate time zone setting in there user profile.
Problem
One example of the problem is when a user attempts to post a journal involving financial
transactions, where the ledger period is checked to see if it is open. For example,
the user is in England attempting to post a journal at 3:00pm on the 30st of November, local
time, the standard Axapta code uses the systemDateGet() function to determine the date to use
in the validation (determining if the period is open). In our case, the AOS is based in
Brisbane Australia and the systemDateGet() function is returning the 1st of December
(local time 1:00am on the 1st of December).
Another example of the problem is where an invoice is posted in the United States on a Friday
and the day of the week where the AOS is situated is a Saturday. We need the system to
record the local date.
Question
Besides rewriting all system code involving systemDateGet(), over 2000 entities, is there
any other options that can be used to get around the problem of getting the correct local
date?
Solution limitations.
In the example given above of the ledger period being closed, it is not possible from a
business practices standpoint to open the next period before end of month processing
has been completed.There is currently no option for the purchase of additional AOS's.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在
Global
类中创建一个函数:然后在
Info.watchDog()
中执行:这可能只是部分解决方案,
watchDog
是仅在客户端执行。Create a function in the
Global
class:Then in
Info.watchDog()
do a:This may only be a partial solution, the
watchDog
is executed on the client side only.这是一个快速更新。如果有任何问题或情况需要解决,请告诉我。
使用当地时间
简介:
以下是正在进行的更新,因为该解决方案尚未在所有情况下进行充分测试。
问题:
如果用户的时区与 AOS 不同,则当需要本地日期时间时,timeNow() 和 systemDateGet() 函数将返回 AOS 详细信息。
澄清剂:
当 Axapta 内的本地日期时间发生更改时,systemDateGet() 函数将返回本地日期,但 timeNow() 函数仍返回 AOS 时间。
编码更改:
为了处理许多不同的情况,已经进行了许多编码更改。可能需要解释的地方将添加评论。
括号已更改为 { 和 } 以允许发布此内容。
类别:全球
我收到的一项要求是允许系统处理公司内可能具有不同时区的多个站点。目前不需要此功能。
实现以下方法作为交叉检查,以确保
systemDateGet()
返回预期值。CLASS:APPLICATION
修改方法
setDefaultCompany
。直接在 super 调用之后添加行setSessionDateTime();
。这是为了在用户更换公司时留出时间进行更改(我收到的另一个要求)。CLASS:INFO
以便系统从会话开始时使用正确的日期/时间。
修改方法
canViewAlertInbox()
,添加行setSessionDateTime();
作为第一行。这是为了处理用户为不同公司打开多个表单的情况。依赖于本地化的更改:
根据您的服务包和本地化,您将需要更改对象的函数以使用 localTime() 函数,替换 timeNow()。重要提示:请勿更改 BatchRun 类以使用新的 localTime 函数,因为这将使其无法正常工作。
在我们的系统中,大约有 260 个实例可以更改。如果您不使用所有模块和本地化,则需要更改的实际行数将会更少。
最后说明:
代码中存在许多 Today() 调用。我还没有检查每一行以确保其编码正确,即使用 Today() 而不是 systemDateGet()。
已知问题:
我遇到过时区更改功能未完全按预期工作的情况。这是当一个会话正在进行数据库同步并且另一个会话在另一家公司打开时。由于普通用户永远无法做到这一点,因此我现阶段没有花太多时间来解决它。这是我确实想要解决的事情。
Here is a quick update. Let me know if there are any issues or situations that need to be addressed.
USING LOCAL TIME
Introduction:
The following is a work in progress update, as the solution has yet to be fully tested in all situations.
Problem:
If the user has a different time zone to the AOS, the timeNow() and systemDateGet() functions are returning the AOS details when the local date time is required.
Clarifiers:
When the local date time is changed within Axapta, the systemDateGet() function will return the local date, however the timeNow() function still returns the AOS time.
Coding changes:
A number of coding changes have been made to handle a number of different situations. Comments will be added where an explanation may be required.
The brackets were changed to { and } to allow this to be posted.
CLASS:GLOBAL
One requirement I was given was to allow the system to handle multiple sites within a company that may have different time zones. Presently this functionality is not required.
The following method was implemented as a cross check to ensure that
systemDateGet()
returns the expected value.CLASS:APPLICATION
Modify the method
setDefaultCompany
. Add the linesetSessionDateTime();
directly after the super call. This is to allow the time to change when the user changes company (another requirement I was given).CLASS:INFO
So that the system uses the correct date/time from the start of the session.
Modify the method
canViewAlertInbox()
adding the linesetSessionDateTime();
as the first line. This is to handle if the user has multiple forms open for different companies.Localization dependent changes:
Depending on your service pack and localizations, you will need to change a function of objects to use the localTime() function, replacing timeNow(). IMPORTANT NOTE: Do not change the class BatchRun to use the new localTime function as this will stop it working correctly.
In our system there were around 260 instances that could be changed. If you do not use all modules and localizations the actual number of lines you need to change will be less.
Final note:
There are a number of today() calls in the code. I have not yet gone through each line to ensure it is coded correctly, i.e. using today() instead of systemDateGet().
Known issues:
I have come across a situation where the timezone change function did not work completely as expected. This was when one session was doing a database synchronisation and another session was opened in a different company. As normal users will never be able to do this, I have not spent much time on its solution at this stage. It is something I do intend to resolve.