Copying Record!!!!

HanenHanen Member Posts: 281
Hi,


what does TRANSFERFIELDS exactely do?

I have a record from a table a copy fom a Sales Line I want to passe it to a record type Sales Line (not an insertion) only for tests.

I used
RecSalesPendingLines := RecSalesLine;

I got an error message that RecSalesPendingLines type should be Sales Line and not Sales Lines Pending.

Help!!!!
:oops:
Regards

Hanen TALBI

Comments

  • kapamaroukapamarou Member Posts: 1,152
    Hanen wrote:
    what does TRANSFERFIELDS exactely do?

    Haven't you used the C/Side reference guide from the help menu?
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    TRANSFERFIELDS copies fields based on the Field No. property of the fields. For each field in Record (the destination), the contents of the field with the same Field No. in FromRecord (the source) will be copied, if such a field exists.

    Please read help for more information on TRANSFERFIELDS..
    ......................

    Regarding the error message..
    you have declared "RecSalesPendingLines" variable as Sales Lines Pending record and assigning it from "Sales Line". Which is wrong..
  • lvanvugtlvanvugt Member Posts: 774
    Hanen wrote:
    I used
    RecSalesPendingLines := RecSalesLine;
    Using the assignment statement - i.e ":=" - with record variables is only possible with variables based on the same Record type. For that reason you get:
    Hanen wrote:
    ... RecSalesPendingLines type should be Sales Line and not Sales Lines Pending.
    TRANSFERFIELD is the one you should (see for details above), and actually it's funny that you ask about that and apparently did not use it ...
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community
  • HanenHanen Member Posts: 281
    Never stop learning :wink:
    Regards

    Hanen TALBI
Sign In or Register to comment.