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;
}