Long story short, I'm being given the internal id for a unit of measure (unitstype) from a saved search that's been provided to me. I need to take that and match it to a base unit and conversion rate. What's the simplest way to do so?
search.create({ "type": "unitstype", "columns": ["internalid", "name", "unitname", "conversionrate", "baseunit"] });...returns everything, units, base units, the works! Great, right? But the given internal id of each unit is not the actual internal id, but rather the internal id of its base unit. Close but no cigar. Also unexpected and misleading.Ok, how about instead searching directly for the internal id I've been given?search.lookupFields({ "type": "unitstype", "id": 9, "columns": ["name", "unitname", "conversionrate", "baseunit"] });...and suddenly...{ "error": { "code": "UNEXPECTED_ERROR", "message": "An unexpected error has occurred. Error ID: iz63is1y1x58a7tdjff9x" } }Ouch. Guess that's not supported.Getting units out of NS seems to have been an issue for people in the past, so I was hoping SS 2.0 could provide an answer. The information is obviously partially available to searches, but why not everything? There must be a technical reason that's not been made clear, right? So far, the only solution I can see is to load the record for every single base unit, pull out all other units as line items to get each internal id, and manually combine the result. Which is a pain, and not something I should have to resort to.Does anyone see a better way forward? Help, please?