Dynamically assign table to dataport

nismo2006nismo2006 Member Posts: 22
Hello everyone,

I was wondering if it was even possible to assign the table number to the dataport dynamically. The reason I want to do this is I have multiple tables that I need to archive and delete and instead of defining 50 different dataports, I would rather define one and allow the table to be defined on the request form. I tried but was unsuccessful and thought before I quit trying, I would ask to see if anyone else has tried. Thanks for the help in advance.

Comments

  • kinekine Member Posts: 12,562
    You can try to define some "generic" dataport, but you will need to save data like "table ID, field ID, field value" and all that in some way to be able to find correct record by primary key etc. Than you can use RecordRef and FieldRef to read and save the data.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • nismo2006nismo2006 Member Posts: 22
    Thanks for the information. I will try it out and see if that will work.
  • BeliasBelias Member Posts: 2,998
    you can also create only 2 dataports (because nav accepts only 40 dataitems at time).

    You have to add a lot of dataitems and dataport fields; it's a tedious work, and far less interesting and challenging than kine's solution, but it's an option
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • David_SingletonDavid_Singleton Member Posts: 5,479
    it will be cheaper to create 50 dataports than one monster one. But more to the point, why dataports?
    David Singleton
  • nismo2006nismo2006 Member Posts: 22
    I thought that one single dataport that is dynamic would be a solution to cleaning up some custom tables. If there is a better solution to this, I would appreciate the suggestions.

    Thanks in advance....
Sign In or Register to comment.