TableBox Problem

Kc_NirvanaKc_Nirvana Member Posts: 146
Hello.
I have one form that has a source table that has 3 fields:
Type, No., Date
Type - Option String - Customer, Vendor
In a new form i want to create a table box that shows the customer ledger entries or the vendor ledger entries by clicking in a button.
I've created a table box with text boxes which point to a TempLedger record that is temporary.
When I fill the templedger only the last record of the templedger is showned in table box.
How can i solve this?
Thanks in advanced
Junior Consultant & Developer in Dynamics NAV

"I'm worse at what I do best
And for this gift I feel blessed
Our little group has always been
And always will until the end"

Nirvana - Nevermind - Smells Like Teen Spirit

Answers

  • PeterDPeterD Member Posts: 66
    Can you give us the code used to fill TempLedger?
  • Kc_NirvanaKc_Nirvana Member Posts: 146
    If you can solve me my problem....... :P
    CLEAR(CustLedgEntry);
    TempCustLedgEntry.DELETEALL;
    CustLedgEntry.SETRANGE("Customer No.","No.");
    IF CustLedgEntry.FIND('-') THEN
    BEGIN
    REPEAT
      TempCustLedgEntry.COPY(T);
      TempCustLedgEntry.INSERT;
    UNTIL CustLedgEntry.NEXT=0;
    END;
    
    Junior Consultant & Developer in Dynamics NAV

    "I'm worse at what I do best
    And for this gift I feel blessed
    Our little group has always been
    And always will until the end"

    Nirvana - Nevermind - Smells Like Teen Spirit
  • ufukufuk Member Posts: 514
    I think you should write the code like:
    TempCustLedgEntry.DELETEALL;
    CustLedgEntry.RESET;
    CustLedgEntry.SETCURRENTKEY("Customer No.");
    CustLedgEntry.SETRANGE("Customer No.","No.");
    IF CustLedgEntry.FIND('-') THEN
      REPEAT
        TempCustLedgEntry.INIT;
        TempCustLedgEntry.TRANSFERFIELDS(CustLedgEntry);    
        TempCustLedgEntry.INSERT;
      UNTIL CustLedgEntry.NEXT=0;
    
    
    Ufuk Asci
    Pargesoft
  • vijay_gvijay_g Member Posts: 884
    do not forget the variable that you are using in table box contains only last value.
  • Kc_NirvanaKc_Nirvana Member Posts: 146
    vijay_g wrote:
    do not forget the variable that you are using in table box contains only last value.
    That is the problem......
    How can i show all records that are in variable?
    Junior Consultant & Developer in Dynamics NAV

    "I'm worse at what I do best
    And for this gift I feel blessed
    Our little group has always been
    And always will until the end"

    Nirvana - Nevermind - Smells Like Teen Spirit
  • vijay_gvijay_g Member Posts: 884
    Kc_Nirvana wrote:
    I've created a table box with text boxes which point to a TempLedger record that is temporary.

    how can you point a table box or text box to a temporery record.
    Either you can use a form based on CLE and keep SOURCETABLETEMPRORY to yes and insert record in Rec at run time.

    this is as i understand may be i missing something that you want.
  • SavatageSavatage Member Posts: 7,142
    maybe I'm over simplifing it - but there are already forms to show CLE's & VLE's why not just call the form depending on which type you choose.

    https://docs.google.com/fileview?id=0Bw ... YmI0&hl=en
  • ufukufuk Member Posts: 514
    You can display only source table's fields as tablebox, if you use a variable then you got the last value. So you need at least two forms.
    Ufuk Asci
    Pargesoft
Sign In or Register to comment.