Reference: https://www.sagecity.com/us/sage300/b/sage_300_erp_r_and_d/posts/rvspy-and-dbspy
//////////////////////////////////////////////////////////////////////////////
// Error codes. There are two sets: old and extended. These can co-exist
// quite well since they don't overlap. Some of the old codes are made
// redundant in the extended codes; these are prefixed with "OLD_".
// Old error codes
#define ERRNUM_SUCCESS 0
#define ERRNUM_LOAD_FAILED 100
#define ERRNUM_OPEN_FAILED 101
#define ERRNUM_COMPOSE_FAILED 102
#define ERRNUM_ROTOENTRY_FAILED 103
#define OLD_ERRNUM_GENERAL 1
#define OLD_ERRNUM_WARNING 10
#define OLD_ERRNUM_OTHER 2
#define OLD_ERRNUM_RECORD_NOT_FOUND 1
#define OLD_ERRNUM_RECORD_NO_MORE_DATA 1
#define OLD_ERRNUM_RECORD_EXISTS 1
#define OLD_ERRNUM_RECORD_DUPLICATE 1
#define OLD_ERRNUM_TABLE_EXISTS 1
// Extended error codes
#define ERRNUM_WARNING WARNING_GENERAL
#define ERRNUM_GENERAL 1000
#define ERRNUM_RECORD_NOT_FOUND 1020
#define ERRNUM_RECORD_NO_MORE_DATA 1021
#define ERRNUM_RECORD_EXISTS 1022
#define ERRNUM_RECORD_DUPLICATE 1023
#define ERRNUM_RECORD_INVALID 1024
#define ERRNUM_RECORD_LOCKED 1025
#define ERRNUM_RECORD_CONFLICT 1026
#define ERRNUM_RECORD_NOT_LOCKED 1027
#define ERRNUM_RECORD_PROTOCOL 1028
#define ERRNUM_TABLE_EXISTS 1040
#define ERRNUM_TABLE_NOT_FOUND 1041
#define ERRNUM_PERMISSION_NONE 1060
#define ERRNUM_MEMORY_NO_MORE 1080
#define ERRNUM_MEMORY_BUFFER_LIMIT 1081
#define ERRNUM_FILTER_SYNTAX 1100
#define ERRNUM_FILTER_OTHER 1101
#define ERRNUM_KEY_INVALID 1120
#define ERRNUM_KEY_NUMBER 1121
#define ERRNUM_KEY_CHANGED 1122
#define ERRNUM_FIELD_INVALID 1140
#define ERRNUM_FIELD_NUMBER 1141
#define ERRNUM_FIELD_INDEX 1142
#define ERRNUM_FIELD_DISABLED 1143
#define ERRNUM_FIELD_READONLY 1144
#define ERRNUM_TRANSACTION_NONE 1160
#define ERRNUM_TRANSACTION_OPEN 1161
#define ERRNUM_REVISION_PROTOCOL 1180
#define ERRNUM_DATABASE_PARAMETER 1200
#define ERRNUM_DATABASE_LIMIT 1201
#define ERRNUM_DATABASE_OTHER 1202
#define ERRNUM_DATABASE_DICTIONARY 1203
#define ERRNUM_RPC_FAILURE 1220 // remote procedure call had communications failure
#define ERRNUM_APPLICATION_DEFINED_BASE 9000
#define ERRNUM_APPLICATION_DEFINED_END 9999
// Extended warning codes
#define WARNING_GENERAL -1
#define WARNING_FILTERDELETE_ORPHANS -10
#define WARNING_FILTERCOUNT_APPROXIMATE -20
#define WARNING_APPLICATION_DEFINED_BASE -1999
#define WARNING_APPLICATION_DEFINED_END -1000