Options

How to copy a record between two tables

a.mouttoua.mouttou Member Posts: 18
hi all,
I'm trying to copy the record of the table 5082 to a user custom table
50011 so i've made a report with the 5082 table.

In the OnAfterGetRecord i put this C/SIDE

//stat : record : 50011

stat.init;
stat.copy("Value Entry");

But i've got a Message telling me that all filters can't be copied at the same time and that only record from the same table can be copied.

Did anyone already try something like this.I don't wanna copy each fileds betwenn the twotables.

Thanks.
Waiting for Dynamics Nav V5
France

Comments

  • Options
    DenSterDenSter Member Posts: 8,304
    If you copied table 5082 as table 50011, then you may have added fields to table 5082 that have not been added to table 50011. When you do a COPY, navision will attempt to put the values of all fields in the source table into identical fields in the target table. When it doesn't find these fields, you get the error you mentioned.

    You can only use the COPY command if both record variables are of the same type, and then only if both tables have the same structure. You need to make this happen, or I'm afraid you're going to have to assign the fields individually.

    HTH
  • Options
    zarrynzarryn Member Posts: 29
    You might want to try TRANSFERFIELDS. It can be used between two different records. The on-line help gives a good description of the functionality and use.
    Zarryn
  • Options
    DenSterDenSter Member Posts: 8,304
    TRANSFERFIELDS only works for the fields in the source table that also exist in the target database, and with the same numbers.
  • Options
    SteveOSteveO Member Posts: 164
    Hi,

    I think that TRANSFERFIELDS is the command you are looking for.
    Check out the help for more info.
    This isn't a signature, I type this at the bottom of every message
  • Options
    a.mouttoua.mouttou Member Posts: 18
    hi all,
    Thanks TRANSFERFIELDS is the solution.
    Regards guys.
    Waiting for Dynamics Nav V5
    France
Sign In or Register to comment.