Temporary Table

Hi Everybody,

I have created a temporary table in a form into Navision. I need to show the records in the temporary table in a tabular form. Is this possible?

Comments

  • Tabular form? As in you wish to display the same table but on each Tab in a different way? (Using a 'Tab Control'?)


    --- edit ---
    Or are you referring to what Navision calls a generic form with a table control?
  • Yes, this is possible. In the OnInit or OnOpenForm trigger, you need to fill your temporary table with the records you want displayed. Then you can use your temporary table as the sourcetable of your form. You can only use your temporary table as the sourcetable in version 5.0.

    Hope this helps,

    Regards,

    Willy
    Fostering a homeless, abused child is the hardest yet most rewarding thing I have ever done.
  • You can indeed use temporary tables in 4.0 (not sure about lower).

    Set the SourceTable to the actual table and do the following:


    Form - OnFindRecord(Which : Text[1024]) : Boolean
    gTemp.COPY(Rec);
    
    IF NOT gTemp.FIND(Which) THEN
      EXIT(FALSE);
    
    Rec := gTemp;
    
    EXIT(TRUE);
    
    Form - OnNextRecord(Steps : Integer) : Integer
    gTemp.COPY(Rec);
    
    lResult := gTemp.NEXT(Steps);
    
    IF lResult <> 0 THEN
      Rec := gTemp;
    
    EXIT(lResult);
    
    Form - OnInsertRecord(BelowxRec : Boolean) : Boolean
    gTemp.COPY(Rec);
    gTemp.INSERT(FALSE);
    EXIT(FALSE);
    
    Form - OnModifyRecord() : Boolean
    gTemp.COPY(Rec);
    gTemp.MODIFY(FALSE);
    EXIT(FALSE);
    
    Form - OnDeleteRecord() : Boolean
    gTemp.COPY(Rec);
    gTemp.DELETE(FALSE);
    EXIT(FALSE);
    

    gTemp in this example is your declared variable of your Temporary Table
  • Hi There,

    It has worked perfectly!! Thanks alot you've been of great help.
  • You're welcome :D
  • If you are on 5.0+ then use the solution provided by KYDutchie. If you are on any earlier version, then you can do the same thing, by using a function (this can be in a report if you don't have a developers license) and populate the Temp Table. Then do a RUNMODAL with MyTempTable as the parameter for the record.

    No need to write any code in the form.
    David Singleton
  • houbeles!

    Dave's solution costs more money! :wink:
  • garak
    edited 2008-07-25
    whippersnapper mode on

    both solutions cost the same ;-)

    granule Form Designer (7120) = 2000 C/Shells (~400USD), Report Designer (7110) = 2000 C/Shells. One Report / One Form ~ 20 USD. Application Builder Granule (7200) cost ~ 4000 USD

    whippersnapper mode off

    And for a newbie, David's solution is the easiest.
    The xyper solution is like in form 634
    Do you make it right, it works too!
  • Xypher wrote:
    houbeles!

    Dave's solution costs more money! :wink:

    How do you figure that?
    David Singleton
  • Ah woops, I'm unfamiliar with what costs what, if anything.

    Boss tells me what object ID's to use, and I type the code. :|

    Still learning. I was only joking around Dave O:)
  • never make a joke about a godly MVP [-X [-o< *lol :lol:
    Do you make it right, it works too!
  • so, what is "houbeles" :?: <- doesn't found this in my dictionary
    Do you make it right, it works too!
  • It's Czech slang.


    From what I gather it's a polite way of saying "poop".
  • Xypher wrote:
    Ah woops, I'm unfamiliar with what costs what, if anything.

    Boss tells me what object ID's to use, and I type the code. :|

    Still learning. I was only joking around Dave O:)

    Interestingly, a client of mine is having some problems, which was leading me to write a blog about this, and then this post from Girish Did anyone do a real ROI analysis after implementing? and now this.

    Before I ever get any developer to start coding, I do an ROI analysis to see if it makes sense to even do. That does nto mean looking just at cost of license, it means increased productivity, developement time, upgrade time, training support etc. You can never just look at one part of the picture and make the decision.
    David Singleton
  • ok ..... and what this mean in anglický or anglický :?:
    Do you make it right, it works too!
  • forgett it, you write it some posts before ....
    Do you make it right, it works too!
  • Xypher wrote:
    It's Czech slang.


    From what I gather it's a polite way of saying "poop".

    Aha you mean houbelec; a better translation would be "nonsense".

    No offense taken by the way. :mrgreen:
    David Singleton