I need to write a code on the insert/update method of custtrans table. This code will be helpful me to insert the current recid (this.recId) of custtrans table to another table (AIFCusttrans - this table is created by me).
Such as:
public void insert()
{
;
AIFCusttrans aifCusttrans_;
select forupdate aifCusttrans_
where aifCusttrans_.RecRecId == this.RecId;
if(aifCusttrans_)
{
aifCusttrans_.RecRecId = this.RecId;
aifCusttrans_.LastUpdatedDatetime = DateTimeUtil::utcNow();
aifCusttrans_.update();
}
else
{
aifCusttrans_.RecRecId = this.RecId;
aifCusttrans_.LastUpdatedDatetime = DateTimeUtil::utcNow();
aifCusttrans_.insert();
}
}
Do i need to put the ttsbegin and ttscommit into this code? please help me.