hi
i have weird problem i wrote some code in navision but when i import
the code in SQL the code dose not work right ](*,)
ok now i well explain the code
the code supose to copy Rec from table Called Ticket and insert this Rec
in the same Table But whit new No. the No. field is the primaryKey
the problem is when i execute the code
this msg appear
do you wont to rename the record
th Code is
Ticket.INIT;
Ticket.COPY(Rec);
Ticket."No.":='';
Ticket."No. Series":='';
Ticket.Confirmed:=FALSE;
Ticket."Conf. Date":=0D;
Ticket.Changed:=FALSE;
Ticket."Change date":=0D;
Ticket.INSERT(TRUE);
and this is the code in the onInsert event
IF "No."='' THEN BEGIN
TravelSetup.GET;
TravelSetup.TESTFIELD(TravelSetup."Ticket No. Series" );
NoSeriesMgt.InitSeries(TravelSetup."Ticket No. Series",xRec."No. Series",0D,"No.","No. Series");
END;
"Date Filter":=WORKDATE;
what is the problem i dont wont this msg To appear #-o [/quote]
Comments
Try this:
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
sory for late
i try this but its still give the same Msg.
i found the problem but i dont know how to fix it
the problem in the secondary Key for the Tiket Table
the key is compound of Three Field
the Msg apper exactly when insert value in the Document No. field
i try to empty the field before insert the New Rec
and the Msg disappeared
by the way the secondary key fields rrefer to Sales Order
i use it to Know Each Tiket refer to which Sales Order Line
so i need to write the Document No in the Rec
](*,) ](*,)
help me Plz
If I am correct, this happens because in the form you use the secondary key to show records and by inserting a record, the buffers get a little mixed up.
You might try to put some code in the "OnInsertRecord"-trigger of the form.
Meaning you save the record "manually", do a refresh of the form, and exit the trigger, saying to Navision to NOT save the record (because you already saved it).
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
sorry for late
i solved the problem i just move some function from the table to the form and evry thing is OK \:D/
thank u again