Created
June 7, 2021 11:41
-
-
Save W3BGUY/d703118b3c92c66b1b864a8e297066f7 to your computer and use it in GitHub Desktop.
Simply function to get any item type by internal ID. Adding this since I've seen multiple questions about how to do it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getItemType(itemID){ | |
| var itemData={}; | |
| try{ | |
| itemData=search.lookupFields({type:search.Type.ITEM,id:itemID,columns:['type','externalid','price','displayname']}); | |
| log.debug('itemData',JSON.stringify(itemData)); | |
| }catch(err01){ | |
| log.error('getItemType('+itemID+').err01',JSON.stringify(err01)); | |
| }finally{ | |
| return itemData; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment