Has anyone seen this error when doing a `SELECT cu...
# suiteql
m
Has anyone seen this error when doing a `SELECT currency FROM account`:
Invalid search query. Detailed unprocessed description follows. Search error occurred: Field 'currency' for record 'Account' was not found. Reason: REMOVED - Field is removed
My theory is that this might be a breaking change that NetSuite introduced for accounts without multi-currency enabled. Does anyone have a NetSuite account without multi-currency enabled to test that query on?
s
multi-currency not turned on -
Search error occurred: Unknown identifier 'currency'. Available identifiers are: {account=account}
t
I have an account with it enabled, and the query works.
It fails for me in a 2021.1 RP account that has multi-currency disabled.
Hope that helps.
m
and does a
SELECT * FROM currency
(with an admin role) yield one result? Similar to the discussion we had a couple weeks ago about subsidiaries
s
in the same account I referenced above that returns an error
m
@stalbert and you are using an admin role/token to execute that query? also which version of NetSuite (2020.2 or 2021.1)?
s
I'm using Tim's glorious suitelet as admin, I think was 2020.2 (just closed that browser)
t
@Marc Reicher Sorry for the delay. I have two solutions going live this afternoon, so it's been... interesting. Anyway, when I run this - SELECT * FROM currency - even in a single currency account, I get multiple rows back!
🤔 1
m
haha damn! Now that's crazy
so as an admin
SELECT * FROM currency
yields multiple rows, and yet the
SELECT currency FROM account
errors?? And my guess is this is happening 2021.1, but not 2020.2
t
Yep! I just confirmed that the "MULTIPLE CURRENCIES" option is unchecked.
Is your goal to be able to detect the multi/ single currency configuration of an account via SuiteTalk?
Ok, so this might help... There's a table named "consolidatedExchangeRate" that seems to only appear in accounts that have multiple currencies enabled.
m
That’s interesting. That should really only exist if there are also multiple subsidiaries (because those rates are only used translate balances from one subsidiary to another)
But yes goal is to be able to detect multi currency via suitetalk which is probably not really possible in a reliable way yet. The ‘select * from currency’ strategy was working for us but looks like it won’t in 2021.1
Though it will likely work if our client just avoids using the admin role
The real BS in my opinion with the API is that the admin role can just magically see certain tables that otherwise are not possible to see
☝️ 1
s
it's not uncommon for a database to have such permisions
I vaguely recall that suitetalk has an API to query configuration, doesn't it? Maybe that would be a more direct detection method?
m
I am only aware of that for SuiteScript. Don't know of a way to check configuration using SuiteTalk
But if you are I am all ears 🙂
s
hmmm, I don't see it there either. I thought there was something like that once upon a time but I may be mistaken.
t
I think the only way to get accurate configuration information is via the N/config module. That won't help with SuiteTalk, but here's a RESTlet that uses it: https://timdietrich.me/blog/netsuite-configuration-info-restlet-follow-up/ If you search for "multicurrency" on that page, you'll see how it's returned in the response.
👍 1
m
We saw some other really crazy behavior with SuiteQL/roles/permissions after doing even more digging. So we have a customer that has a NetSuite account without multi-currency enabled. We saw the same behavior that @tdietrich posted:
SELECT * FROM currency
will work with an admin role.
SELECT currency FROM account
will error, saying that the field currency was removed/isn't valid We then had our client download a role that we have available in a bundle. The role was created in our own NetSuite account, and does have
Lists => Currencies
available on it. As expected though, when our client downloaded our bundle, the new role that was created in their NetSuite account did not have
Lists => Currencies
on it. This was expected on my end at least, b/c I've seen that when you download roles that have permissions that aren't applicable to your NetSuite account, those permissions don't show up in the UI. Interestingly enough, we then created a token attached to the new role, and the
SELECT * FROM currency
still worked! Our theory was that the role actually had the
Lists => Currency
permission behind the scenes, but it just didn't show up in the UI. So we then had the client re-open the role in the UI, click edit, and click save without actually making any changes. Sure enough,
SELECT * FROM currency
now starting erroring out. So basically, when you download a role from a bundle, it can actually get permissions on it that would otherwise not be available in the UI for that account.