DA for Mac OS problem

dataabstract
oxygene

(Alan Olson) #1

I have written the following code that I believe deletes some detail records when for me:

 If self.JobDetTable.rowCount>0 then
      begin
        for d:Integer := self.JobDetTable.rowCount downto 1 do
          self.JobDetTable.removeRow(self.JobDetTable.rowAtIndex(d-1));
          
        DataLib.fDataModule.applyChangesForTable(self.JobDetTable);
        
      end;

The loop processes correctly, but when I get to the ApplyChangesForTable() call I get the following error:

An exception occurred in maajobs, thread 6898

Type: NSException

Message:

Some errors were encountered while applying changes to server: 

 Table 'jobdetail': 1 error(s) were found during update. 

 1: No rows were affected by this update

Call Stack:

00007FFF50BEDC46, libobjc.A.dylib, , objc_exception_throw, objc_exception_throw()
0000000103128A51, maajobs, DARemoteDataAdapter.m, -[DARemoteDataAdapter applyChangesForTables:], DARemoteDataAdapter.applyChangesForTables:(NSArray)
00000001030EA506, maajobs, MainWindowController.pas, -[MainWindowController DeleteJobClick:], MainWindowController.DeleteJobClick:(id*)

What am I doing wrong?

DA version 9.4.0.1393
Elements/Fire version 10.0.0.2245


(marc hoffman) #2

This would usually happen if you apply an “empty” update, eg one that would effect no change, either because it has no values changed, or because its set to update an existing row based on a primary key that no longer exists.