Subject | RE: [IBO] Duplicating rows |
---|---|
Author | Riho-Rene Ellermaa |
Post date | 2002-03-04T13:49:18Z |
Sorry, my english must be real bad.
Usually the users enter data normal way - they press Insert button (the generatorlink assigns new ID, GetDocnumber() method in AfterInsert event gets called and doc. number is assigned) and everything is fine. Now, once in a while they want to get the data from old records and press Duplicate button
OnDuplicateClick()
{ sRowData=Query.RowData;
Insert()
//now AfterInsert event is called - generatorlink assignes new ID and doc. number is generated.
Query->RowData=sRowData // I enter duplicate values which _overwrite_ previously defined values
Query->Field("ID")= new value //or key violation will occure
Query->Field("DOCNO")=GetDocNo();
}
Riho-Rene Ellermaa
senior programmer
Hansabank
[Non-text portions of this message have been removed]
Usually the users enter data normal way - they press Insert button (the generatorlink assigns new ID, GetDocnumber() method in AfterInsert event gets called and doc. number is assigned) and everything is fine. Now, once in a while they want to get the data from old records and press Duplicate button
OnDuplicateClick()
{ sRowData=Query.RowData;
Insert()
//now AfterInsert event is called - generatorlink assignes new ID and doc. number is generated.
Query->RowData=sRowData // I enter duplicate values which _overwrite_ previously defined values
Query->Field("ID")= new value //or key violation will occure
Query->Field("DOCNO")=GetDocNo();
}
Riho-Rene Ellermaa
senior programmer
Hansabank
[Non-text portions of this message have been removed]