hi good evening one and all
i have created two tables
table 1 and table 2
table 1 consists of fields
no name designation
1 bbb kkkk
2 nnn mmm
3 kkk llllll
table 2 consists of fields
no name designation
i want to copy data from table 1 to table 2
i have written code like this as shown below
table1.RESET;
IF table1.FINDFIRST THEN
REPEAT
INIT;
no :=table1.no;
name :=table1.name;
designation :=table.designatio;
INSERT;
UNTIL table1.NEXT=0;
but it was not inserting any values into the table2
can any one can give suggetsion
thank you
0
Comments
Where did you write above code?
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
actually one thing i dont know where to write the code..can you send any pdf file regarding this triggers,,,,when and where to write the code...it will be helpful to me ...thank you
i have tried in on after get record in reports(but the data was not inserted)
i have tried in on validate of no field in table 2(but the data was not inserted)
i have tried in on insert in table 2(but the data was not inserted)
http://msdn.microsoft.com/en-us/library/dd301068.aspx
You need to take Table1 as dataitem and check whether record is available in table2, if not insert..
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
i have tried the below code in
predataitem() with processing only yes
testing.RESET;
IF testing.FINDFIRST THEN REPEAT
test9.INIT;
test9.no :=testing.no;
test9.designation:=testing.designation;
test9.INSERT;
UNTIL testing.NEXT=0;
it was working fine
thanks for your reply
can you share me the pdf file linc..please
If you want to copy the table as it is, you can also use the 'TRANSFERFIELDS' function in the 'OnAfterGetRecord()' trigger of the report with the following code :
Ram.
SalesInvHeader does not have a Document Type but HeaderLog does.
HeaderLog is otherwise identical.
Option 0 = Invoice
SalesInvHeader.GET("No.");
IF NOT HeaderLog.GET(0,SalesInvHeader."No.") THEN BEGIN
HeaderLog.INIT;
HeaderLog."Document Type" := 0;
HeaderLog."No." := SalesInvHeader."No.";
HeaderLog.INSERT;
HeaderLog.TRANSFERFIELDS(SalesInvHeader,FALSE);
HeaderLog.MODIFY;
END;
If you only need a subset of the SalesInvHeader transferred to HeaderLog, remove the unwanted fields in HeaderLog.