AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
DAX
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 11.06.2022, 20:15   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
How to write to an event log from inside of a transaction
Источник: http://alexvoy.blogspot.com/2022/06/...om-inside.html
==============



// to write your log from inside of another transaction
static public void insertExtEventLogInSeparateConnection(RefRecId _lineRecId, str _guid, str _logSource, str _logStr)
{
ExtEventLog log;
UserConnection connection;
int ttsLevel = appl.ttsLevel(); //here you can check if you are inside of a transaction
str errMsg = strFmt("Cannot add event log '%1:%2:%3'", _guid, _logSource, _logStr);
// let's create a separate connection
try
{
connection = new UserConnection();
connection.ttsbegin();
log.setConnection(connection);
log.InstructionDocLineRecId = _lineRecId;
log.TaskGUID = _guid;
log.LogStr = _logStr;
log.LogSource = _logSource;

log.doInsert();
connection.ttscommit();
}
catch
{
throw error(errMsg);
}
finally
{
if(connection)
{
connection.finalize();
}
}
}





Источник: http://alexvoy.blogspot.com/2022/06/...om-inside.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
stephenmann: Technical History of Dynamics AX - From Axapta 3.0 to AX2012 Blog bot DAX Blogs 5 03.03.2017 10:22
atinkerersnotebook: Walkthrough & Tutorial Summary Blog bot DAX Blogs 1 09.09.2013 09:11
atinkerersnotebook: Using Service Management to Track Service Orders Blog bot DAX Blogs 1 25.08.2013 19:16
emeadaxsupport: Intercompany time postings incomplete at transaction voucher level when project date differs from the day posted Blog bot DAX Blogs 0 19.08.2013 19:11
Axilicious:Propagate infolog messages to the windows event log Blog bot DAX Blogs 0 04.11.2011 10:14
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 17:17.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.