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

(4) ShareShare
ReportReport
Posted on by 227
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;
 
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    16,318 Super User 2025 Season 1 on at
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    16,318 Super User 2025 Season 1 on at
    Fill up data from temporary table to normal table
    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
    Teddy Herryanto (That NAV Guy) Profile Picture
    13,622 Moderator on at
    Fill up data from temporary table to normal table
    How did you fill in the ItemAvailbleTemp record?
    It looks like the variable ItemAvailbleTemp is empty.
  • Suggested answer
    YUN ZHU Profile Picture
    82,673 Super User 2025 Season 1 on at
    Fill up data from temporary table to normal table
    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
  • Gerardo Rentería García Profile Picture
    18,643 Most Valuable Professional on at
    Fill up data from temporary table to normal table

    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
    Ramesh Kumar Profile Picture
    4,051 on at
    Fill up data from temporary table to normal table
    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.
     
     

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

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

#1
YUN ZHU Profile Picture

YUN ZHU 374 Super User 2025 Season 1

#2
Mansi Soni Profile Picture

Mansi Soni 247

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 231 Most Valuable Professional

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans