简体   繁体   English

Microsoft动态导航:错误消息日志

[英]Microsoft Dynamics NAV: Error Message Log

I'm still new to using Dynamics NAV and I'm still a junior Dev so I have a few questions: 我对使用Dynamics NAV还是很陌生,我仍然是初级开发人员,所以我有几个问题:

I need to be able to Log error messages in NAV as they happen, I have the following fields in a table: 我需要能够在发生NAV时记录错误消息,我在表中具有以下字段:

1 Entry No. Integer 1个条目号整数
2 Error Message Integer 2错误消息整数
3 Object ID Integer 3对象ID整数
4 Session ID Integer 4个会话ID整数
5 User ID Integer 5用户ID整数
6 Object Name Text 250 6对象名称文本250

It needs to log that information when an error occurs, I'm not really sure how to do it. 当发生错误时,它需要记录该信息,我不太确定该怎么做。

I'm not sure if you are trying to log errors in a specific object you are working on. 我不确定您是否要尝试在正在处理的特定对象中记录错误。

Typically, I use 通常,我使用

   String := GETLASTERRORTEXT

in my custom code, when calling other Codeunits. 在我的自定义代码中,当调用其他Codeunits时。 This will give you the error description, which you can insert into your custom error log table. 这将为您提供错误描述,您可以将其插入到自定义错误日志表中。

Here is the documentation: 这里是文档:

https://docs.microsoft.com/en-us/dynamics-nav/getlasterrortext-function https://docs.microsoft.com/en-us/dynamics-nav/getlasterrortext-function

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM