How to compare 2 field data in two table?

xin
xin Member Posts: 10
Hi,

Do anyone know how to compare field data locate at different table by their Field ID/Field Caption?

Eg:
Table(Item) Table(Field)
ID 1 - No. ID 1 No.

How can we differential the value is same / different? & there is alot field need to be compare..

Please help..

Comments

  • matttrax
    matttrax Member Posts: 2,309
    Assuming you need to do this in code. There a table called Field. Add a record variable of that subtype and use the symbol menu to see all of the fields in the Field table. That should get you started.
  • kine
    kine Member Posts: 12,562
    I think that using RecordRef and FieldRef will be best way. You can iterate through all fields of one table and search for corresponding field in second one by name, caption or ID.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • xin
    xin Member Posts: 10
    Thanks matttrax and kine..

    I will try on it..

    Anyways.. kine, do you have any example of how to use the RecordRef and FieldRef?
  • kine
    kine Member Posts: 12,562
    You will find many examples on this forum, documentation and e.g. in Change log codeunit...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Belias
    Belias Member Posts: 2,998
    i think this tip&trick can solve your problem at 80%...
    http://www.mibuso.com/forum/viewtopic.php?f=5&t=22457
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog