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 :
Finance | Project Operations, Human Resources, ...
Unanswered

Item exist function returns item not does not exist

(7) ShareShare
ReportReport
Posted on by 17
In some of our customised programs or classes we check if item exist using standard D365 function(see code below).
But the problem is that many times we have created the item in released product, we got return from the following function that item does not exist. It may probably like few hours to 2 days the function returns item exist.
We are puzzled why is it so.
Did anybody also encountered this issue ? 
for your info, as i debug this code, InventTableCacheFlight is enabled in our D365
 
Code
public static boolean exist(ItemId _itemId)
{
if (_itemId)
{
if (InventTableCacheFlight::instance().isEnabled())
{
SysGlobalObjectCache cache = classFactory.globalObjectCache();
container key = [curExt(), _itemId];
str scope = InventTable::cacheScope();

container result = cache.find(scope, key);
if (!result)
{
result = [InventTable::existInternal(_itemId)];
cache.insert(scope, key, result);
}
return conPeek(result, 1);
}
return InventTable::existInternal(_itemId);
}

return false;
}
Categories:
I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    303,375 Super User 2026 Season 1 on at
    Hi,

    I do think you shared the coding of the InventTable::exists method, correct? I suggest to debug this scenario where you can see if the correct itemID value is passed and what exactly gets returned.
     
    In case you created an item using X++ coding, you can overwrite the cache value. You can also bypass these methods and do a select statement on the InventTable directly from your customization.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 514 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 390

#3
Adis Profile Picture

Adis 266 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans