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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Item Quantities on all location

(1) ShareShare
ReportReport
Posted on by 129
Hello everyone,
I got a task which is a customization like add a factbox on service item worksheet, which shows selected item's quantities on all location.
Is it even possible to make this customization?
I'm stuck on this task :(
 
I have the same question (0)
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    22,128 Super User 2026 Season 1 on at
  • Alexander Drogin Profile Picture
    262 on at
    Very much possible, don't give up. :-)
    Essentially, all you need to do is show the value of the Inventory field from the Item record for each worksheet line. If it must be split per location, then for each location, you need to apply a filter on the Item's "Location Filter" field and run CalcFields in a loop for each location code.
  • Gerardo Rentería García Profile Picture
    25,555 Most Valuable Professional on at
  • Suggested answer
    YUN ZHU Profile Picture
    99,055 Super User 2026 Season 1 on at
    Yes, it's not difficult.
    Simply put, it requires two steps.
    1. Create a ListPart page with reference to the following data
    2. Add the ListPart to the page and use the following method to associate the lines.
     
    Hope this can give you some hints.
    Thanks
    ZHU
  • TB-28100618-0 Profile Picture
    129 on at
    Thanks for your replies!
    It calculates perfectly but when I select other line on Service Line then table changes but factbox cant be changed.
    I tried Currpage.Update(False) but not working
     

  • TB-28100618-0 Profile Picture
    129 on at
    I did not use SubPageLink because I thought there was nothing to link Worksheet Page and Factbox page
     
  • Verified answer
    Alexander Drogin Profile Picture
    262 on at
    You are on the right track, but there are certainly a few things to fix.
     
    1. Regarding the SubPageLink property - it is not so much about the type of the subpage (factbox or document lines), it rather depends on what kind of data is presented in the subpage. If you want to keep the location records in a temporary table and reset it on the main page update, then be it, you don't need SubPageLink.
     
    2. The main problem is that page objects are not singletons. Every page variable in your code is a new instance of the page, unrelated to what is actually displayed in the main page. For this reason, ServiceItemWorksheetPage.Update does not do anything visible in the client. The right way to update the subpage in this case is via CurrPage."Item Quantities".Page. This way you are referring to the actual instance rendered in the client. All triggers in the page extension should call the update function in the factbox this way. And you can delete all local page variables, you don't need them.
     
    3. The source table for the Item Quantities Factbox page is not actually temporary (I mean temporary as an in-memory table). Your code actually inserts records into a table that exists in the database. This is slower compared to in-memory operations, and also unsafe, because multiple users opening this page simultaneously will be deleting each other's records. This page will be a mess in concurrent sessions.
     
    4. Looping on item ledger entries is not fastest way of calculating the sum. Use CalcSums("Remaining Quantity") or Item.CalcFields(Inventory), this will be way faster.
  • TB-28100618-0 Profile Picture
    129 on at
    Hey! Alexander Drogin
    Thanks for your kind reply and suggestions!
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,926 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,158 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 533 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans