web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Fill up data from temporary table to normal table

(5) ShareShare
ReportReport
Posted on by 281
Hello,
          I want to fill up data from Temporary table to normal table, by editing the qty, and getting that qty into normal table , on Action-I am not able to do it properly , kindly suggest me the code here. When it comes to findset it goes directly to end.
 ItemAvailbleTable.Reset();
        ItemAvailbleTable.SetRange("Item No.", MOItem."Item No.");
        IF ItemAvailbleTable.FindFirst() THEN;
 
        ItemAvailblePage.LookupMode(true);
        ItemAvailblePage.SetTableView(ItemAvailbleTable);
        if ItemAvailblePage.RunModal() = Action::LookupOK then begin
            ItemAvailbleTableTemp.Reset();
            ItemAvailbleTableTemp.SetRange("Item No.", ItemAvailbleTable."Item No.");
            IF ItemAvailbleTableTemp.FindFirst() THEN;
 
            MOItem.Reset();
            MOItem.SetRange("MOCode", Rec."MOCode");
            if MOItem.FindFirst() then
                ItemAvailbleTableTemp.Reset();
            ItemAvailblePage.SetSelectionFilter(ItemAvailbleTableTemp);
            ItemAvailbleTableTemp.SetCurrentKey("Item No.", "Location Code");
            if ItemAvailbleTableTemp.FindSet() then begin
                repeat
                    MOItem.Quantity := ItemAvailbleTable."Qty to Allocate";
                    MOItem."Location Code" := ItemAvailbleTable."Location Code";
                    MOItem."Unit Price excl. VAT" := ItemAvailbleTable."Last Unit Price";
                    MOItem."Line Amount excl. VAT" := MOItem.Quantity * MOItem."Unit Price excl. VAT";
                    MOItem.Modify(true);
                    LineNo += 1000;
                until ItemAvailbleTable.Next() = 0;
            end;
        end;
 
I have the same question (0)
  • Suggested answer
    Ramesh Kumar Profile Picture
    7,529 Super User 2025 Season 2 on at
    ItemAvailbleTableTemp.FindSet() is used on the temp table after selection filter is applied. Inside the loop, you're using ItemAvailbleTableTemp, not ItemAvailbleTable anymore. MOItem.SetRange("Item No.", ...) is used to make sure the correct item line is found before modifying.
     
    I have below suggestion which might help find the error message
     
    Thanks
    Ramesh
     
    If this was helpful, please check the "Does this answer your question?" box and mark it as verified.
     
     
  • Gerardo Rentería García Profile Picture
    25,373 Most Valuable Professional on at

    Hi, good day
    I hope this can help you, and give you some hints.

    The copy method on temporary records – The BC Docs Librarian

    Best Regards
    Gerardo

  • Suggested answer
    YUN ZHU Profile Picture
    95,748 Super User 2025 Season 2 on at
    If the code only contains this paragraph, no value is inserted into ItemAvailbleTableTemp, which is empty, so there is no way to find data.
     
    Hope this can give you some hints.
    Thanks.
    ZHU
  • Suggested answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    14,284 Super User 2025 Season 2 on at
    How did you fill in the ItemAvailbleTemp record?
    It looks like the variable ItemAvailbleTemp is empty.
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,647 Super User 2025 Season 2 on at
    ItemAvailbleTableTemp is empty because you never inserted or copied any data into it, so when you try to FindFirst or FindSet, it finds nothing and ends immediately. You must first fill the temporary table before you can loop through it.
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,647 Super User 2025 Season 2 on at

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,066

#2
YUN ZHU Profile Picture

YUN ZHU 658 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 595

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans