Posted invent journal

Hello, In version 2.5 there is a standard problem with the commitment control. You cannot enter but of a inventJournal within ttsbegin/ttscommit. for example: ttsbegin //Function to posted inventJournal //Function to posted inventJournal ttscommit Al to try to enter the second inventJournal to me remains blocked the system. Exists way to solve this?

Hi Alexis, Could you let us know the following info please - 1. Are you importing these journals by code? If so could you post the code here please. 2. Version of service pack that you are using. From your message, it looks like when you try to post second invent journal, you get TTS level error message. Could you please confirm this? If this is the case you might have to run a small job which would correct this error. Regards, Harish Mohanbabu

Hi, you can see the job: inventjournalTable inventJournalTAble; HitActualizaFechaDiarios HitActualizaFechaDiarios = new HITActualizaFechaDiarios(); ; ttsbegin; while select inventJournalTAble index hint numIdx where ! inventJournalTable.Posted if(inventJournaltable.RecId) { HITActualizaFechaDiarios.parmToDate(systemDateGet()); HITActualizaFechaDiarios.parmJournalId(inventJournalTable.JournalId);; } ttscommit; //The function in HitActualizaFechaDiarios: void run() { inventjournalTable table; inventJournalTrans trans; int cont; int conta; ; Table = inventJournalTable::find(journalId,true); table.HITFecha = toDate; if(table.RecId) { table.doUpdate(); info(strfmt(“Actualizado el diario núm. %1”,journalId)); } while select forupdate trans index hint numIdx where trans.JournalId == journalId { trans.TransDate = todate; trans.update(); } } In the first treated journal everything works correctly. In the second the system is blocked. This does not happen if we suppressed ttsbegin. because?

Hi Alexis, I just had a quick look at the code snippet. It looks like you are updating inventjournalTable and inventJournalTrans once. Try calling ttsbegin…ttscommit separately for each update. Axapta would not let you use the tts for different transaction scopes. Hope this helps, Harish Mohanbabu

Hi Harish, In the above conversation you said u know a job to tackle out ttsbegin/ttscommit error.You please let me know about it. Thanks in advance. Regards Priyank

Hi Priyank, Occasionally one might experience an error message with TTSLevel. This could happen for instance when a programmer wrongly places TTS while importing records through X++ jobs. In cases like this Axapta might put a lock on transaction whereby the system would not allow the user to proceed ahead. In cases like this, “ttsabort” should be called at the appropriate level. For instance, let us there is an error message at Level 1. So you can write something like following in a job - real ttno; ; ttno = appl.ttsLevel(); if (ttno == 1) { ttsabort; } When the job is run, this should correct the TTS error. Regards, Harish Mohanbabu