Copy Record

I want to ask about copy a record, may be u can give me a solution I was create a table, let says Table Payment Line, this table I was copy from sales invoice line with new few fields added How to copy record from sales invoice line table into payment line table that I was created, with filtering by only invoice no ? Regards AKO

Check out the TRANSFERFIELDS function - it sounds as though will do what you want. Dan.

Try copy if you need to copy a set of filtered records ie : PaymentLine.COPY(SalesLine); tarek_demiati@ureach.com

Be careful now! Using TRANSFERFIELDS or COPY between records not belonging to the same table could potentially create undesired results. Lars Strøm Valsted Head of Project and Analysis Columbus IT Partner A/S

Transfer Fields will copy just fine it copys the fields with the same number and type. Code between new variables PaymentLine.INIT; PaymentLine.TRANSFERFIELDS(SalesLine); // Maybe Change the Key PaymentLine.“Document No.”:=PaymentHeader.“No.”; PaymentLine.INSERT; David Cox MindSource (UK) Limited Navision Solutions Partner Email: david@mindsource.co.uk Web: www.mindsource.co.uk

Just m point! TRANSFERFIELDS transfers all fields with same number and type - but what if you don’t want all fields transferred? Or if you later add a field to one of the table, which just happens to have the same number and type - but that field is one that you don’t want transferred? I’m not saying that you should not use TRANSFERFIELDS, I’m just saying that you should be careful :slight_smile: Lars Strøm Valsted Head of Project and Analysis Columbus IT Partner A/S

Quite Right Lars Code at this level should be written or checked by a senior developer for such Issues. If you have copied the “Sales Line” table and called it “Payment Line” there will be redundant fields “Qty. to Ship” maybe, you should remove them or blank them. Proper project management and numbering should be used. If I add a feild to the Sales Line table, I reserve that field number within the Sales Area. So if I added a field 50000 to “Sales Line” If I want it to be copied to the Shipment Line I add it. If I then created a new field for the Shipment Line only I would use 50001 David Cox MindSource (UK) Limited Navision Solutions Partner Email: david@mindsource.co.uk Web: www.mindsource.co.uk