Locrec := Rec; NrRec := 0; NrRecToInvoice := 0; NrRecInvoiced := 0; NrRecordIncomplete := 0; IF FIND('-') THEN REPEAT CASE Stato OF Stato::"ToInvoice" : NrRecToInvoice := NrRecToInvoice + 1; Stato::Invoiced : NrRecInvoiced := NrRecInvoiced + 1; Stato::Complete : BEGIN NrRec := NrRec + 1; Stato := Stato::"ToInvoice"; MODIFY; END; ELSE NrRecordIncomplete := NrRecordIncomplete + 1; END; UNTIL NEXT = 0 ELSE ERROR('Nessun record è stato selezionato!'); IF (NrRec + NrRecToInvoice) = 0 THEN ERROR('No record FOUND to invoice!'); IF CONFIRM(STRSUBSTNO('Found\' + '%1 record incomplete\%2 record complete\' + '%3 record to invoice\%4 record invoiced\\'+ 'Continue?',NrRecordIncomplete,NrRec,NrRecToInvoice,NrRecInvoiced),TRUE) THEN BEGIN Rec := Locrec; "State filter" := "State filter"::"To invoice"; "ApplyFilter"; END ELSE ERROR(''); Rec := Locrec;
Comments
SQL:
1
10
100
2
20
200
Navtive:
1
2
10
20
100
200
Is this your problem?