Hi,
I want to do a dataport that export all records that have one field not cheked, and them when the dataport finish to export check this field. I have that code :
Movimientos tarjetas - OnPostDataItem()
recMovimientos.SETRANGE(recMovimientos.Sincronizado,FALSE);
recMovimientos.FINDFIRST;
REPEAT
recMovimientos.Sincronizado := TRUE;
recMovimientos.MODIFY;
UNTIL (recMovimientos.NEXT = 0);
But it doesnt work, is like the navision dont do a COMMIT, if i put a commit at the end it works. Some sugestions ?
Thanks for all.
0
Comments
substitute your code with this one...recMovimientos2 it's the same rec variable of recMovimientos...
recMovimientos.SETRANGE(recMovimientos.Sincronizado,FALSE);
recMovimientos.FINDSET;
recMovimientos2.RESET;
REPEAT
recMovimientos2.get(recMovimientos."primary key");
recMovimientos2.Sincronizado := TRUE;
recMovimientos2.MODIFY;
UNTIL (recMovimientos.NEXT = 0);
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
1 FALSE (when changed to TRUE you jump from 1st to 4th record)
2 FALSE (this one is skipped)
3 FALSE (this one is skipped)
4 TRUE
Alternatively you can try to loop from end to top:
If you need to modify a field that you filter on, then you have two options:
1 - you use a second variable to modify the record, just like Belias suggests.
2 - you use the FINDSET parameter to control its behavior. Go to the C/SIDE reference guide under the Help menu and read about FINDSET.
RIS Plus, LLC
I see on debug and the value change to false but dont save in database.
If i put the COMMIT sentence at the end the program works. THe tableview of the dataport its SORTING(No. Tarjeta,Numero Documento Asociado) ORDER(Ascending) WHERE(Sincronizado=CONST(No))
](*,) I think its for the type of transaction, but i try with all combinations. More suggestions please.
Thanks.
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
I dont know what i do but i dont have.
Some suggestions ???
Here is the code:
OBJECT Dataport 50000 Exportar Tarjetas MM.AA
{
OBJECT-PROPERTIES
{
Date=18/03/08;
Time=14:03:43;
Modified=Yes;
Version List=;
}
PROPERTIES
{
FileFormat=Variable;
OnPostDataport=BEGIN
MESSAGE('proceso finalizado correctamente');
END;
}
DATAITEMS
{
{ PROPERTIES
{
DataItemTable=Table50002;
AutoSave=Yes;
AutoUpdate=Yes;
AutoReplace=Yes;
DataItemTableView=SORTING(No. Tarjeta,Numero Documento Asociado)
ORDER(Ascending)
WHERE(Sincronizado=CONST(No));
OnAfterExportRecord=BEGIN
recMovimientos.GET("Movimientos tarjetas"."No. Tarjeta","Movimientos tarjetas"."Numero Documento Asociado");
recMovimientos.Sincronizado := TRUE;
recMovimientos.MODIFY;
END;
}
FIELDS
{
{ ; ;"Fecha Registro" }
{ ; ;"No. Tarjeta" }
{ ; ;"Numero Documento Asociado" }
{ ; ;Descripcion }
{ ; ;"Importe Documento" }
{ ; ;"No. Puntos" }
{ ; ;"No. Cliente" }
{ ; ;"Nombre Cliente" }
{ ; ;"Nombre Empresa" }
{ ; ;Sincronizado }
}
}
{ PROPERTIES
{
DataItemTable=Table50000;
DataItemTableView=SORTING(No. Tarjeta,Cod. Cliente)
ORDER(Ascending)
WHERE(Sincronizado=CONST(No));
OnAfterExportRecord=BEGIN
recTarjetas.GET("Tarjeta Cliente"."No. Tarjeta","Tarjeta Cliente"."Cod. Cliente");
recTarjetas.Sincronizado := TRUE;
recTarjetas.MODIFY;
END;
}
FIELDS
{
{ ; ;"No. Tarjeta" }
{ ; ;"Fecha Entrada Vigor" }
{ ; ;"Fecha Caducidad" }
{ ; ;"Cod. Cliente" }
{ ; ;Saldo }
{ ; ;"Nombre de la Empresa" }
{ ; ;Sincronizado }
{ ; ;"No. Series" }
}
}
}
REQUESTFORM
{
PROPERTIES
{
Width=9020;
Height=3410;
}
CONTROLS
{
}
}
CODE
{
VAR
recMovimientos@1000000000 : Record 50002;
recTarjetas@1000000001 : Record 50000;
BEGIN
END.
}
}
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!