Sabbu,
I believe you are right... that is the best
approach...
From: Axapta-Knowledge-Village@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Subrahmanyam, Mamidi
Sent: Tuesday, September 27, 2005 11:31 AM
To: Axapta-Knowledge-Village@yahoogroups.com
Subject: Re: [Axapta-Knowledge-Village] SalesFormLetter.insertJournal()
Hello Brandon,
I believe this should solve it......You can browse similar code on
AOT\classedd..
ttsbegin;
numberSeq = this.allocateNumAndVoucher();
[number, voucher] = this.getNumAndVoucher();
numberSeq = this.allocateNumAndVoucher();
[number, voucher] = this.getNumAndVoucher();
if
(this.updateNow())
{
{
this.postUpdate();
TransactionLog::create(this.transactionLogType(),this.transactionLogTxt());
ttscommit;
}
else
ttscommit;
}
else
{
throw
error
ttsabort; // Subbu
}
Brandon George <[EMAIL PROTECTED]> wrote:
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;
}
elsethrow errorWhat 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
Yahoo! for Good
Click here to donate to the Hurricane Katrina relief effort.
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
- Visit your group "Axapta-Knowledge-Village" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.