Search code examples
netsuitesuitescriptsuitescript2.0

NetSuite List of File Types with Alpha & numeric IDs


Does anyone have a list of NetSuite File Type IDs, both the alpha id, and the numeric id.

Need to expand on the following list

var filetype = {
    10 : 'PLAINTEXT',
    12 : 'XMLDOC',
    14 : 'CSV',
    17 : 'PDF',
    38 : 'JSONFILE',
};

The requirement is to get a custom preference of list type "File Type", which returns the numeric ID.

Then pass that to filetype[numeric_id] to return the actual alpha ID.


Solution

  • For those who want a useful object constant for the common file types:

    const FILETYPES = {
    'AUTOCAD' : {typeid : 'AUTOCAD', name : 'AutoCad', extension : '.dwg', contentType : 'application/x-autocad', internalid : 34},
    'BMPIMAGE' : {typeid : 'BMPIMAGE', name : 'BMP Image', extension : '.bmp', contentType : 'image/x-xbitmap', internalid : 6},
    'CSV' : {typeid : 'CSV', name : 'CSV File', extension : '.csv', contentType : 'text/csv', internalid : 14},
    'EXCEL' : {typeid : 'EXCEL', name : 'Excel File', extension : '.xls', contentType : 'application/vnd.ms-excel', internalid : 22},
    'FLASH' : {typeid : 'FLASH', name : 'Flash Animation', extension : '.swf', contentType : 'application/x-shockwave-flash', internalid : 1},
    'GIFIMAGE' : {typeid : 'GIFIMAGE', name : 'GIF Image', extension : '.gif', contentType : 'image/gif', internalid : 4},
    'GZIP' : {typeid : 'GZIP', name : 'GNU Zip File', extension : '.gz', contentType : 'application/x-gzip-compressed', internalid : 27},
    'HTMLDOC' : {typeid : 'HTMLDOC', name : 'HTML File', extension : '.htm', contentType : 'text/html', internalid : 9},
    'ICON' : {typeid : 'ICON', name : 'Icon Image', extension : '.ico', contentType : 'image/ico', internalid : 8},
    'JAVASCRIPT' : {typeid : 'JAVASCRIPT', name : 'JavaScript File', extension : '.js', contentType : 'text/javascript', internalid : 13},
    'JPGIMAGE' : {typeid : 'JPGIMAGE', name : 'JPEG Image', extension : '.jpg', contentType : 'image/jpeg', internalid : 2},
    'JSON' : {typeid : 'JSON', name : 'JSON File', extension : '.json', contentType : 'application/json', internalid : 38},
    'MESSAGERFC' : {typeid : 'MESSAGERFC', name : 'Message RFC', extension : '.eml', contentType : 'message/rfc822', internalid : 35},
    'MP3' : {typeid : 'MP3', name : 'MP3 Audio', extension : '.mp3', contentType : 'audio/mpeg', internalid : 30},
    'MPEGMOVIE' : {typeid : 'MPEGMOVIE', name : 'MPEG Video', extension : '.mpg', contentType : 'video/mpeg', internalid : 29},
    'MSPROJECT' : {typeid : 'MSPROJECT', name : 'Project File', extension : '.mpp', contentType : 'application/vnd.ms-project', internalid : 25},
    'PDF' : {typeid : 'PDF', name : 'PDF File', extension : '.pdf', contentType : 'application/pdf', internalid : 17},
    'PJPGIMAGE' : {typeid : 'PJPGIMAGE', name : 'PJPEG Image', extension : '.pjpeg', contentType : 'image/pjpeg', internalid : 3},
    'PLAINTEXT' : {typeid : 'PLAINTEXT', name : 'Plain Text File', extension : '.txt', contentType : 'text/plain', internalid : 10},
    'PNGIMAGE' : {typeid : 'PNGIMAGE', name : 'PNG Image', extension : '.png', contentType : 'image/x-png', internalid : 5},
    'POSTSCRIPT' : {typeid : 'POSTSCRIPT', name : 'PostScript File', extension : '.ps', contentType : 'application/postscript', internalid : 21},
    'POWERPOINT' : {typeid : 'POWERPOINT', name : 'PowerPoint File', extension : '.ppt', contentType : 'application/vnd.ms-powerpoint', internalid : 23},
    'QUICKTIME' : {typeid : 'QUICKTIME', name : 'QuickTime Video', extension : '.mov', contentType : 'video/quicktime', internalid : 28},
    'RTF' : {typeid : 'RTF', name : 'RTF File', extension : '.rtf', contentType : 'application/rtf', internalid : 20},
    'SMS' : {typeid : 'SMS', name : 'SMS File', extension : '.sms', contentType : 'application/sms', internalid : 18},
    'STYLESHEET' : {typeid : 'STYLESHEET', name : 'CSS File', extension : '.css', contentType : 'text/css', internalid : 11},
    'TIFFIMAGE' : {typeid : 'TIFFIMAGE', name : 'TIFF Image', extension : '.tiff', contentType : 'image/tiff', internalid : 7},
    'VISIO' : {typeid : 'VISIO', name : 'Visio File', extension : '.vsd', contentType : 'application/vnd.visio', internalid : 24},
    'WORD' : {typeid : 'WORD', name : 'Word File', extension : '.doc', contentType : 'application/msword', internalid : 19},
    'XMLDOC' : {typeid : 'XMLDOC', name : 'XML File', extension : '.xml', contentType : 'text/xml', internalid : 12},
    'ZIP' : {typeid : 'ZIP', name : 'Zip File', extension : '.zip', contentType : 'application/zip', internalid : 26},
    'AutoCad' : {typeid : 'AUTOCAD', name : 'AutoCad', extension : '.dwg', contentType : 'application/x-autocad', internalid : 34},
    'BMP Image' : {typeid : 'BMPIMAGE', name : 'BMP Image', extension : '.bmp', contentType : 'image/x-xbitmap', internalid : 6},
    'CSV File' : {typeid : 'CSV', name : 'CSV File', extension : '.csv', contentType : 'text/csv', internalid : 14},
    'Excel File' : {typeid : 'EXCEL', name : 'Excel File', extension : '.xls', contentType : 'application/vnd.ms-excel', internalid : 22},
    'Flash Animation' : {typeid : 'FLASH', name : 'Flash Animation', extension : '.swf', contentType : 'application/x-shockwave-flash', internalid : 1},
    'GIF Image' : {typeid : 'GIFIMAGE', name : 'GIF Image', extension : '.gif', contentType : 'image/gif', internalid : 4},
    'GNU Zip File' : {typeid : 'GZIP', name : 'GNU Zip File', extension : '.gz', contentType : 'application/x-gzip-compressed', internalid : 27},
    'HTML File' : {typeid : 'HTMLDOC', name : 'HTML File', extension : '.htm', contentType : 'text/html', internalid : 9},
    'Icon Image' : {typeid : 'ICON', name : 'Icon Image', extension : '.ico', contentType : 'image/ico', internalid : 8},
    'JavaScript File' : {typeid : 'JAVASCRIPT', name : 'JavaScript File', extension : '.js', contentType : 'text/javascript', internalid : 13},
    'JPEG Image' : {typeid : 'JPGIMAGE', name : 'JPEG Image', extension : '.jpg', contentType : 'image/jpeg', internalid : 2},
    'JSON File' : {typeid : 'JSON', name : 'JSON File', extension : '.json', contentType : 'application/json', internalid : 38},
    'Message RFC' : {typeid : 'MESSAGERFC', name : 'Message RFC', extension : '.eml', contentType : 'message/rfc822', internalid : 35},
    'MP3 Audio' : {typeid : 'MP3', name : 'MP3 Audio', extension : '.mp3', contentType : 'audio/mpeg', internalid : 30},
    'MPEG Video' : {typeid : 'MPEGMOVIE', name : 'MPEG Video', extension : '.mpg', contentType : 'video/mpeg', internalid : 29},
    'Project File' : {typeid : 'MSPROJECT', name : 'Project File', extension : '.mpp', contentType : 'application/vnd.ms-project', internalid : 25},
    'PDF File' : {typeid : 'PDF', name : 'PDF File', extension : '.pdf', contentType : 'application/pdf', internalid : 17},
    'PJPEG Image' : {typeid : 'PJPGIMAGE', name : 'PJPEG Image', extension : '.pjpeg', contentType : 'image/pjpeg', internalid : 3},
    'Plain Text File' : {typeid : 'PLAINTEXT', name : 'Plain Text File', extension : '.txt', contentType : 'text/plain', internalid : 10},
    'PNG Image' : {typeid : 'PNGIMAGE', name : 'PNG Image', extension : '.png', contentType : 'image/x-png', internalid : 5},
    'PostScript File' : {typeid : 'POSTSCRIPT', name : 'PostScript File', extension : '.ps', contentType : 'application/postscript', internalid : 21},
    'PowerPoint File' : {typeid : 'POWERPOINT', name : 'PowerPoint File', extension : '.ppt', contentType : 'application/vnd.ms-powerpoint', internalid : 23},
    'QuickTime Video' : {typeid : 'QUICKTIME', name : 'QuickTime Video', extension : '.mov', contentType : 'video/quicktime', internalid : 28},
    'RTF File' : {typeid : 'RTF', name : 'RTF File', extension : '.rtf', contentType : 'application/rtf', internalid : 20},
    'SMS File' : {typeid : 'SMS', name : 'SMS File', extension : '.sms', contentType : 'application/sms', internalid : 18},
    'CSS File' : {typeid : 'STYLESHEET', name : 'CSS File', extension : '.css', contentType : 'text/css', internalid : 11},
    'TIFF Image' : {typeid : 'TIFFIMAGE', name : 'TIFF Image', extension : '.tiff', contentType : 'image/tiff', internalid : 7},
    'Visio File' : {typeid : 'VISIO', name : 'Visio File', extension : '.vsd', contentType : 'application/vnd.visio', internalid : 24},
    'Word File' : {typeid : 'WORD', name : 'Word File', extension : '.doc', contentType : 'application/msword', internalid : 19},
    'XML File' : {typeid : 'XMLDOC', name : 'XML File', extension : '.xml', contentType : 'text/xml', internalid : 12},
    'Zip File' : {typeid : 'ZIP', name : 'Zip File', extension : '.zip', contentType : 'application/zip', internalid : 26},
    

    }