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.



YAHOO! GROUPS LINKS




Reply via email to