after use the debugger, it cause the error from following code.
but i still don't know why. :(
please help me. thanks a lot.
\Classes\PurchLineType\insert
================================================================================================
public void insert(boolean dropInvent = false,
boolean findMarkup = true)
{
#OCCRetryCount
InventUpd_Estimated estimated;
NumberSeq numberSeq;
InterCompanySkipUpdate interCompanySkipUpdate = purchLine.SkipUpdate;
;
try
{
ttsbegin;
this.setReverseCharge_UK();
purchTable = purchLine.purchTable(update);
if (purchTable.isInterCompanyOrder() && purchLine.inventTable().interCompanyBlockedPurch())
throw error(strfmt("@SYS74812", purchLine.ItemId));
if (purchLine.SkipUpdate == InterCompanySkipUpdate::No
&& purchTable.interCompanyAllowIndirectCreationOrig())
throw error(purchTable.interCompanyAllowIndirectCreationOrig());
if (purchLine.creditNoteLine())
purchLine.TransactionCode = IntrastatParameters::find().DefaultCreditNote;
numberSeq = NumberSeq::newGetNum(InventParameters::numRefInventTransId());
purchLine.InventTransId = numberSeq.num();
if (!purchLine.VendAccount || !purchLine.VendGroup)
{
purchLine.VendAccount = purchTable.OrderAccount;
purchLine.VendGroup = purchTable.VendGroup;
}
if (purchLine.SkipUpdate != InterCompanySkipUpdate::InterCompany
&& purchLine.SkipUpdate != InterCompanySkipUpdate::Both)
this.interCompanyMirror();
purchLine.setPurchStatus(); <<<<<<<<<<<<<<<THIS ROW CAUSE ERROR MESSAGE.
if (!dropInvent)
{
estimated = InventUpd_Estimated::newInventMovement(InventMovement::construct(purchLine));
estimated.updateNow();
}
purchLine.doInsert();
if (purchLine.SkipUpdate != InterCompanySkipUpdate::Internal
&& purchLine.SkipUpdate != InterCompanySkipUpdate::Both)
this.syncSalesLineSave(purchLine,true);
if (estimated)
estimated.updateReservation();
purchTable.updateBackStatus();
if (findMarkup
&& (purchLine.PurchQty >= 0
|| (purchLine.PurchQty < 0 &&
purchLine.SkipUpdate == InterCompanySkipUpdate::No)))
purchLine.createMarkupTrans(purchTable);
if (findMarkup
&& purchLine.PurchQty < 0
&& purchLine.SkipUpdate == InterCompanySkipUpdate::Internal)
purchLine.interCompanyRevertMarkupTrans();
if (purchLine.SkipUpdate != InterCompanySkipUpdate::InterCompany
&& purchLine.SkipUpdate != InterCompanySkipUpdate::Both)
this.interCompanyMarkupMirror();
purchLine.SkipUpdate = InterCompanySkipUpdate::No;
purchLine.doUpdate();
ttscommit;
}
catch (Exception::Deadlock)
{
retry;
}
catch (Exception::UpdateConflict)
{
if (appl.ttsLevel() == 0)
{
if (xSession::currentRetryCount() >= #RetryNum)
{
throw Exception::UpdateConflictNotRecovered;
}
else
{
retry;
}
}
else
{
throw Exception::UpdateConflict;
}
}
catch (Exception::Error)
{
ttsabort;
throw error("@SYS93835");
}
if (interCompanySkipUpdate == InterCompanySkipUpdate::No)
{
this.interCompanyCalcDisc();
}
}
================================================================================================
\Data Dictionary\Tables\PurchTable\Methods\updateBackStatus
================================================================================================
void updateBackStatus()
{
PurchTableType purchTableType;
;
purchTableType = this.type();
purchTableType.updateBackStatus(); <<<<<<<<< INSIDE THE FUNCTION, THIS ROW CAUSE ERROR MESSAGE.
}
================================================================================================
\Classes\PurchLineType\updateBackStatus
================================================================================================
void updateBackStatus()
{
ttsbegin;
purchTable.PurchStatus = PurchLine::lowestPurchStatus(purchTable.PurchId);
purchTable.doUpdate(); <<<<<<<<< FINALLY, INSIDE THE FUNCTION, THIS ROW CAUSE ERROR MESSAGE.
ttscommit;
}
================================================================================================
ERROR:
---Cannot edit a record in Purchase orders (PurchTable).
---The record has never been selected.