Ok,
 
 So here is what I did...
 
protected void  insertJournal()
{;
 
   ttsbegin;
    numberSeq           = this.allocateNumAndVoucher();
   [number, voucher]    = this.getNumAndVoucher();
 
    if (this.updateNow())
    {
 
        this.postUpdate();
 
        TransactionLog::create(this.transactionLogType(),this.transactionLogTxt());
        ttscommit;
    }
    else
    {
       throw error(strFmt("@SYS21533"));
       ttscommit;
    }
 
}
 
Added another ttscommit in the else{} block. I believe this is a bug, and maybe a lot of people have not entered into causing the updateNow() to return false based on conditions. That's why I am writing. If this is a bug, I will report it, and post the fix on the web! Either way, I just confirmed this works well.
 
-Brandon


From: Axapta-Knowledge-Village@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Brandon George
Sent: Tuesday, September 27, 2005 9:12 AM
To: Axapta-Knowledge-Village@yahoogroups.com
Subject: [Axapta-Knowledge-Village] SalesFormLetter.insertJournal()

Hello All!
 
 I am writing custom Intercompany code. The "Out of the Box" Axapta Intercompany code works nothing like my company wants it too. Not to get to much into detail here, but that is that. So I have wrote a class, and created two tables that will handle the Intercompany Sales Order process.
 
Anyway there is a piece of code in the SalesFormLetter, the insertJournal() method. This method, to me, is setup strange:
 
 ttsbegin;
    numberSeq           = this.allocateNumAndVoucher();
   [number, voucher]    = this.getNumAndVoucher();
 
    if (this.updateNow())
    {
 
        this.postUpdate();
 
        TransactionLog::create(this.transactionLogType(),this.transactionLogTxt());
        ttscommit;
    }
    else
        throw error
 
What is strange to me is why the ttsbegin: and ttscommit are not on the same "level" or scope? I have seen this cause issues, and cause an unbalanaced TTSbegin / TTSCommit error, which makes the user have to close out and start a new session.
 
This happens of course when the Else is fired because the updateNow() returns false. Reason of course is the ttscommit is never reached, I believe. I was wondering if anyone has ever had any experince with this method, and why this method must execute like it does?
 
thanks,
Brandon
 


Sharing the knowledge on Axapta.



SPONSORED LINKS
Business finance course Business to business finance Small business finance
Business finance consultant Business finance magazine Business finance uk


YAHOO! GROUPS LINKS




Reply via email to