Open a Table without a var record....

philippegirodphilippegirod Member Posts: 191
I want to be able to open a tabledata in a codeunit for instance, sending the ID of the table in the parameters....

I've no idea of any solution...

- I tried to create as many variables as I have tables in Navision but it's impossible, I've a system error, navision is not able to compile such an object....
My file text was similar to that
  CODE
  {

    PROCEDURE AllTables@1000000000();
    VAR
      RecPaymentTerms@10003 : Record 3;
      RecCurrency@10004 : Record 4;
      RecFinanceChargeTerms@10005 : Record 5;
      RecCustomerPriceGroup@10006 : Record 6;
      RecStandardText@10007 : Record 7;
      RecLanguage@10008 : Record 8;
      RecCountry@10009 : Record 9;
      RecShipmentMethod@100010 : Record 10;
      RecSalespersonPurchaser@100013 : Record 13;
etc....

:?: Is there a function wich allows to open directly a table without having a variable for this record.... and launch a processing in this table ?

(I'm not really a developper, just a consultant who need to do some code, but i'm able to understand.... a few words in programming)
My candle burns by both ends, it will not last the night,
But oh my foes and oh my friends, it gives a lovely light

Comments

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Starting from Navision 3.60, some new datatypes are introduces for working with variable tables at run-time:
    recordref, fieldref, keyref.

    You can open eg. the customer table - Table 18 - using following code:
    myrecrefvar.OPEN(18);
    
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • philippegirodphilippegirod Member Posts: 191
    :D THANKS !!!! :D:D
    My candle burns by both ends, it will not last the night,
    But oh my foes and oh my friends, it gives a lovely light
  • philippegirodphilippegirod Member Posts: 191
    Do you have any code samples for this function RecordRef ?
    How apply a filter ?
    How choose a field in the table and copy the value of this field ?
    How can I use A FieldRef instance ?......
    My candle burns by both ends, it will not last the night,
    But oh my foes and oh my friends, it gives a lovely light
  • RobertMoRobertMo Member Posts: 484
    Check "Export Navision Table Data PRO" that utilizes these functions.
    You will have a good example tor start.
    http://www.mibuso.com/dlinfo.asp?FileID=350

    And tell me how did it worked for you...
               ®obi           
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Do you have any code samples for this function RecordRef ?
    Search and you shall find: RecordRef Sample
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
Sign In or Register to comment.