Temporary Tables

aarjitaaarjita Member Posts: 6
edited 2005-09-13 in Navision Attain
Hi All,

In a customization,I have used a temporary table whose data is viewed thru a form.on this table when i try to execute functions like FIND,COUNT they do not give the expected result.I wish to know more about temporary tables and transactions done thru them.
Secondly,while displaying the data i have distinguished consecutive records by changing the forecolor property dynamically.But when i click on a record say 3rd record,it changes its color to the color record 2 is and the record 2 changes its color to what record 3 had earlier.How can this be stopped?

Thanks in advance.
Arjita

Comments

  • HalMdyHalMdy Member Posts: 429
    Concerning Colors, could you please copy here the code you made for the change ? Is this code in the OnFormat Trigger ?
  • DenSterDenSter Member Posts: 8,307
    When you use a temporary record variable, the variable is basically an empty object that is stuctured like the table that you base the variable on. There are no records in a temporary record variable, it is completely empty until you write the records yourself.

    So if you have 25000 records in your Item table, and 2500 begin with the letter B, then when you create a temporary Item variable, and filter it on *B*, you will find no records, because it is an empty object in memory that needs to be filled before you can display anything.
  • aarjitaaarjita Member Posts: 6
    Hi Daniel,
    Thanks a lot for your response.Well in my code,I copied data from a record variable(not temporary table) through COPYFILTERS.Suppose,tmptable is the temp. table and myRec is the record variable.I filtered myRec n then copied it to tmpTable as
    tmpTable.COPYFILTERS(myRec);
    For me this statement does not give the desired result.Further,when I execute tmpTable.COUNT,tmpTable.FIND, after tranferring data,count gives value 0.Please correct me if I am wrong.
    Thanks
    Arjita
  • aarjitaaarjita Member Posts: 6
    Hi,
    Regarding color change,I have written the code in OnFormat trigger of a control on the form.I want to differentiate two vendors of the same item.So I have written the code as-
    IF VendorNo<>xrec.VendorNo THEN
    CurrForm.ItemNo.UPDATEFORECOLOR(255);
    While running the form,the vendors are differentiated as one in red and other one in black.But as soon as I select any of the vendors,if it is in red,it changes color to black and the neighboring records change their color to black.This change in the color scheme is reflected as all red into black and all black into red.Please provide me more assistance on this.
    Thanks
    Arjita
  • HalMdyHalMdy Member Posts: 429
    1. COPYFILTERS : this copy only filters (as the name says), not Table Datas !!! If you need to copy datas between real and temporally tables, you need to make such code :
    RealTable.FIND('-');
    REPEAT
      TmpTable := RealTable;
      TmpTable.INSERT;
    UNTIL RealTable.NEXT = 0
    


    2. Colors : doesn't work with xRec, that why you have this "blinking colors" effect.
    One suggestion is to have a new field in your table to identify clearly the "vendor changes" and use this field as condition for the UPDATEFORECOLOR in the trigger OnFormat
Sign In or Register to comment.