How to get temp table records

backofmoonbackofmoon Member Posts: 15
Hi,

I use Nav 5.0.

When I debug Codeunit Job Calculate WIP, I can only 'watch' the first record of table Variable. Does any one can help tell me how to get all records from the variable at one time.

1. it's a temporary table.
2. there are lots of records, I can't loop one by one.

Thanks in advance!

Vince

Comments

  • BeliasBelias Member Posts: 2,998
    you can't (from debugger). try to proceed like this:
    put a form.RUNMODAL(0,temptable) (dunno if you can do it, because you're probably in the middle of a transaction) or form.RUN(0,temptable) (but you'll probably get an empty table, if the temptable is deleted somewhere) at the and of the loop that fills the temptable.

    otherwise do a little mod to the code. Firstly you have to create a copy of the temptable from the object designer in your database. After that you have to real records in it: you can achieve this by adding a pair of lines of code and one record variable. In the same loop where the temptable is filled in :wink:
    After you finish debugging, you can open that real table manually from the obj designer
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • backofmoonbackofmoon Member Posts: 15
    Great thanks for your advice!

    I'll try to add some code to record.
    But I debug a error transaction, when it's done, nothing in real table.
    Maybe it's all rolled back?!
  • BeliasBelias Member Posts: 2,998
    backofmoon wrote:
    But I debug a error transaction
    ouch, you spotted the weak point of my approach :)

    in that case you have to try to program something like this (i don't know if it works, it depends on when the temptable is deleted:
    find where the error comes out and add some lines of code before it, just like this
    if errorcondition then
      form/page.RUNMODAL(0,mytemptable);
    if errorcondition then  // existing line
      ERROR('this is the error you are getting'); // existing line
    
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • backofmoonbackofmoon Member Posts: 15
    I'll try that code.

    Anyway thanks for your reply!
Sign In or Register to comment.