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

Community site session details

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

Displaying Item Image in a Custom List Page

(1) ShareShare
ReportReport
Posted on by 519
BC SaaS v24.5 here. I have added a Tenant Media variable to my custom list page (ItemImage). And this variable's Content has been added a field to my custom list page (ItemImage.Content). My question is when it comes to iterating the records and displaying the item images, not all items have images defined. So I want to handle that, and not have the list page field referencing the last match for some other item. My code handling this is below. My thinking is the Init() method will handle this okay. Any downsides? I'm not inserting a blank record in the Tenant Media recordset. Just essentially creating a blank for that iteration.
 
if Item.Picture.Count > 0 then begin
                ItemImage.Get(Item.Picture.Item(1));
                ItemImage.CalcFields(Content);
end else
                ItemImage.Init();
 
I have the same question (0)
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    19,158 Super User 2025 Season 2 on at
    Displaying Item Image in a Custom List Page
  • Greg Kujawa Profile Picture
    519 on at
    Displaying Item Image in a Custom List Page
    Thanks, but my method of displaying these item images is working. That's not the question. The question is if using the Init() method for creating essentially a blank/missing item image is going to add a lot of overhead or bloat anything. Some of these list pages will have 10-20K rows. Currently the list pages don't seem to be too sluggish to render and navigate. But nevertheless was concerned about adding all of the Init() loops for those rows without item images available.
     
    What I'm doing is using a temporary Item Ledger Entry table. Querying the real Item Ledger Entry table, cross referencing other tables such as the Item table, and adding records to my temporary table. After I get each record for my list page I am pulling the item image associated with each ILE line. If a particular item doesn't have an image I need to account for that. Otherwise that page variable is just repeating the last item image that was available.   
  • Suggested answer
    YUN ZHU Profile Picture
    92,727 Super User 2025 Season 2 on at
    Displaying Item Image in a Custom List Page
    Why is it so complicated? The Picture field in the item table is empty if no picture is set, so just add this filter before the loop.
     
    Hope this helps.
    Thanks.
    ZHU

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 4,308

#2
Sumit Singh Profile Picture

Sumit Singh 2,798

#3
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 2,793

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans