hai all
i am new to navision programming
i have a problem in coping the records from a perticulat field of a table to another table
for example
item1 is the table which i have created
i want to copy all the item nos from item table to item1 table's itemno field which is not a primary key.
All the records should be copied at a time.
is it possible?
i have tried in so many ways but not able to get . ](*,)
i think it is understandable,
please help me in this senario
thanks in advance
0
Comments
Item would be a Record type variable pointing to the Item table, Item2 would be a Record type variable pointing to your new table.
Also, you say that the Item No. field in your target table is not the primary key? If so, you would need to fill in your primary key fields as well.
www.NextEqualZero.com
A technical eye on Dynamics NAV
This function can be used to copy fields between record types that are not the same (e.g. use TransferFields to copy data from a Sales Line record to a Sales Inv. Line record).
Check out the online documentation of TRANSFERFIELDS(Record) in Navision help.
Epimatic Corp.
http://www.epimatic.com
i got the solutuion
It will not work as there will be issue with Key
Try this:
IF Item.FINDSET THEN BEGIN
REPEAT
CLEAR(NewRecord);
NewRecord.TRANSFERFIELDS(Item);
//for update
if not NewRecord.INSERT then
NewRecord.modfy;
//for insert only:
if not NewRecord.INSERT then;
UNTIL Item.NEXT = 0;
END;