I can't tell "best practice" but any function will do same thing in background. Will reach to bag, bank etc and search item in your conditions...
Code:
local bagId = BAG_BACKPACK
-- check: http://wiki.esoui.com/Constant_Values#BAG_BACKPACK
local bagSlots = GetBagSize(bagId) -1
for slotIndex = 0, bagSlots do
local itemType = GetItemType(bagId, slotIndex)
local link = GetItemLink(bagId, slotId)
local itemID = select(4,ZO_LinkHandler_ParseLink(link))
if itemID == xxxx and itemType == blabla then
-- code goes here
end
end
Sorry for bad English, but basically any function will do this in background like i said.
Regards