Insert Data to a Table by Only Knowing The Table ID

Dear All,

I am trying to insert a data to a table by only knowing the table ID. Let's say I have the number 18 at hand and I will do an insert to Customer table? Is it possible to reach the customer table and insert (or modify) data with only knowing the number 18?

Thanks,
Ararat

Best Answers

  • ararat85
    ararat85 Member Posts: 17
    Answer ✓
    Are you sure that inserting or modifying the data without knowing anything but a table number is a good idea?

    RecordRef allows you to manipulate data in a generic way. Use
    Recref.OPEN(18)
    
    and the Recrefpoints to table 18. After calling Recref.OPEN(18) subsequent call to Recref.FIND*, Recref.INSERT ,Recref.MODIFY etc will operate on table 18.


    Table ID is not the only data I have of course :)

    Thanks for the answer.

Answers

  • Slawek_Guzek
    Slawek_Guzek Member Posts: 1,692
    Are you sure that inserting or modifying the data without knowing anything but a table number is a good idea?

    RecordRef allows you to manipulate data in a generic way. Use
    Recref.OPEN(18)
    
    and the Recrefpoints to table 18. After calling Recref.OPEN(18) subsequent call to Recref.FIND*, Recref.INSERT ,Recref.MODIFY etc will operate on table 18.


    Slawek Guzek - www.yitron.co.uk
    Business Central, MS SQL Server, Wherescape RED;
  • ararat85
    ararat85 Member Posts: 17
    Answer ✓
    Are you sure that inserting or modifying the data without knowing anything but a table number is a good idea?

    RecordRef allows you to manipulate data in a generic way. Use
    Recref.OPEN(18)
    
    and the Recrefpoints to table 18. After calling Recref.OPEN(18) subsequent call to Recref.FIND*, Recref.INSERT ,Recref.MODIFY etc will operate on table 18.


    Table ID is not the only data I have of course :)

    Thanks for the answer.