Options

Temp Tables displayed on Forms

eYeeYe Member Posts: 168
Hi this, is probably a stupid question, but how in the world can I use buffer tables?

What I want to do is display the contents of a global (temp) variable in list view, and not the actual contents of the table.
Kind Regards,
Ewald Venter

Answers

  • Options
    krikikriki Member, Moderator Posts: 9,090
    The easiest way is :
    FORM.RUNMODAL(FORM::"Your Form",tmpYourTempTable);
    
    The form will behave like a normal form, but it will work on your temptable.
    If you want to pass some other parameters, the easiest way is to pass them as filters.
    E.g. you have a temptable on T27:item and you want to send also a customer no..
    tmpItem.RESET;
    tmpItem.SETRANGE("No.",codCustomerNo.);
    FORM.RUNMODAL(FORM::"Your Form",tmpYourTempTable);
    

    In the OnOpenForm of the form, you can check if there is a filter on "No." and you know that in reality it is the customer no. you send into the form.
    codCustomerNo := GETFILTER("No.");
    rec.RESET;
    

    There are also other ways of using temptables or passing parameters, but they are more complicated.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Options
    eYeeYe Member Posts: 168
    Ahh, yes! Thanks.

    Forgot about that one! I was in the habbit of calling forms by:
    IF gFrmItemList.RUNMODAL = ACTION::LookupOK THEN
    

    But your suggestion works perfectly, thanks again!
    Kind Regards,
    Ewald Venter
  • Options
    David_SingletonDavid_Singleton Member Posts: 5,479
    Sorry to disagree, but either the Subject of this thread is wrong, or the replies and content are wrong.

    A buffer table is used in Navision posting routines to consolidate many lines of data into less lines that are similar.

    For example, when you post AR in a sales invoice, you post just one GL and Cust entry for the amount due. This line is created using the Invoice Buffer table. Or when posting Inventory cost to GL, you can post per item ledger entry, or per posting group. Posting per group reduces the amount of data posted, and makes it easier to see what is going on. POS and retail systems are also good candidates for Buffer tables.
    David Singleton
  • Options
    krikikriki Member, Moderator Posts: 9,090
    Sorry to disagree, but either the Subject of this thread is wrong, or the replies and content are wrong.

    A buffer table is used in Navision posting routines to consolidate many lines of data into less lines that are similar.

    For example, when you post AR in a sales invoice, you post just one GL and Cust entry for the amount due. This line is created using the Invoice Buffer table. Or when posting Inventory cost to GL, you can post per item ledger entry, or per posting group. Posting per group reduces the amount of data posted, and makes it easier to see what is going on. POS and retail systems are also good candidates for Buffer tables.
    Well I went with the idea he meant a temporary table. But you are right, I should also have explained this. =D>
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Options
    David_SingletonDavid_Singleton Member Posts: 5,479
    Maybe change the Subject of the Thread, then in six months time when someone searches for "Temporary Table" and see my reply they will think "What is this Singleton guy talking about". #-o
    David Singleton
  • Options
    KowaKowa Member Posts: 918
    A buffer table is used in Navision posting routines to consolidate many lines of data into less lines that are similar.
    In addition to this there are some new buffer tables like 5821 "Item Statistics Buffer" that are not used for grouping or posting, but for calculation of statistical values. f.e. Report 712 applies flowfilters to this table to calculate the values printed.
    Kai Kowalewski
  • Options
    eYeeYe Member Posts: 168
    Subject is updated.

    I was under the impression that a buffer table has a physical structure but no data. That you create a global temp variable of this table and then use it to do some calculations or display the data?
    Kind Regards,
    Ewald Venter
  • Options
    David_SingletonDavid_Singleton Member Posts: 5,479
    eYe wrote:
    Subject is updated.

    I was under the impression that a buffer table has a physical structure but no data. That you create a global temp variable of this table and then use it to do some calculations or display the data?

    Basically yes, but Buffer tables and Temporary tables are two completely different things. It just happens though that in the majority of cases, Buffer tables are as you say not inserted into the database, so in code you would generally create a Temporary Table of type Buffer table.

    In simpler terms, a Temporary Table is a part of the fin.exe, so its a technical thing. A buffer table is a part of the business logic, and is created int he database.

    There are some cases where buffer tables are inserted into the database, you will see this in Retail, where a days transactions are added to a buffer table, instead of being posted, and then at the end of the day the buffer is posted.
    David Singleton
Sign In or Register to comment.