Marc Reicher
03/18/2021, 9:47 PMtransactionaccountingline.amount
field? I feel like the data may come from a lot of different tables depending on the features enabled in the netsuite accounttdietrich
03/18/2021, 11:17 PMSELECT
TAL.Amount,
Currency.Symbol,
Currency.ExchangeRate AS Rate_Current,
Transaction.ExchangeRate AS Rate_Trans
FROM
Transaction
INNER JOIN TransactionAccountingLine AS TAL ON
( TAL.Transaction = Transaction.ID )
INNER JOIN Currency ON
( Currency.ID = Transaction.Currency )
WHERE
Transaction.ID = 2466063
Marc Reicher
03/18/2021, 11:48 PMtransaction.currency
would be GBP
• the transactionline.foreignamount
would be in GBP
• the transactionaccountingline.amount
would be in USD
I don't believe the transaction
, the transactionline
, or the transactionaccountingline
has a field that shows the currency of the transactionaccountingline.amount
field (though I could be wrong). I know I could join on the subsidiary
for some NetSuite accounts (and just look at the subsidiary.currency
value), but there are two other interesting edge cases where this strategy wouldn't work:
• NetSuite accounts without subsidiaries (i.e. non NetSuite OneWorld) but with multi-currency enabled
• NetSuite accounts with subsidiaries but without multi-currency enabled
In those two situations, I'm not sure where I'd grab the currencyMarc Reicher
03/19/2021, 12:07 AMtdietrich
03/19/2021, 12:11 AMaccount
AccountingBookSubsidiaries
amortizationSchedule
billingAccount
BillingRateCardPriceMultiForSearch
budgets
charge
customer
customerCurrencyBalance
customerItemPricing
employee
EmployeeExpenseReportCurrencies
ExpenseCategoryRate
expenseMachine
fairValuePrice
InvoiceGroup
invtItemPriceHistory
job
memDocTransactionTemplate
otherName
priceBook
pricePlan
pricing
ProjectIcChargeRequest
promotionCode
promotionCodeCurrency
revenueElement
subscription
subsidiary
subsidiaryAccountingBookDetail
transaction
vendor
vendorCurrencyBalance
Marc Reicher
03/19/2021, 12:20 AMtdietrich
03/19/2021, 12:21 AMtdietrich
03/19/2021, 12:21 AMfeatures = config.load( { type: config.Type.FEATURES } );
Marc Reicher
03/19/2021, 12:26 AM&xml=true
to the end of the URL
https://{account_id}.app.netsuite.com/app/common/otherlists/company.nl?whence=&xml=true
Interestingly enough, this revealed that the company settings page is actually rendering a subsidiary record (see screenshot)?
Any chance you have access to a NetSuite account that does not have subsidiaries enabled? I wonder what recordType
would be listed in the xmlMarc Reicher
03/19/2021, 12:27 AMtdietrich
03/19/2021, 12:27 AMtdietrich
03/19/2021, 12:30 AMMarc Reicher
03/19/2021, 12:31 AMselect * from subsidiary
will fail for that customertdietrich
03/19/2021, 12:34 AMMarc Reicher
03/19/2021, 12:35 AMtdietrich
03/19/2021, 12:36 AMtdietrich
03/19/2021, 12:36 AMMarc Reicher
03/19/2021, 12:39 AMMarc Reicher
03/19/2021, 12:39 AMtdietrich
03/19/2021, 12:40 AMMarc Reicher
03/19/2021, 12:40 AMtdietrich
03/19/2021, 12:40 AMMarc Reicher
03/19/2021, 12:41 AMselect * from subsidiary
query always fails. I never even considered that it would work if you ran it as an adminMarc Reicher
03/19/2021, 12:42 AMtdietrich
03/19/2021, 12:42 AMtdietrich
03/19/2021, 12:43 AMtdietrich
03/19/2021, 12:43 AM{
"excludebsfromglnumbering": null,
"incomesummaryprofitaccount": null,
"externalid": null,
"balancesheetclosingaccount": null,
"allowperiodendjournalentries": "F",
"subsidiary": 6,
"createbscloseandopenjournals": null,
"createincomesummaryjournals": null,
"balancesheetopeningaccount": null,
"requirememoonperiodendjournals": null,
"groupbythesesegments": null,
"incomesummarylossaccount": null,
"id": 6
},
tdietrich
03/19/2021, 12:43 AMMarc Reicher
03/19/2021, 12:46 AMsubsidiary
join is the answer after all. It just won't work for non OneWorld accounts unless an admin token is used. What a strange thing to have to explain to a customer 🙂Marc Reicher
03/19/2021, 12:46 AMtdietrich
03/19/2021, 12:47 AMtdietrich
03/19/2021, 12:47 AMtdietrich
03/19/2021, 12:49 AMtdietrich
03/19/2021, 12:51 AMtdietrich
03/19/2021, 12:53 AMMarc Reicher
03/19/2021, 12:53 AMtdietrich
03/19/2021, 12:54 AMMarc Reicher
03/19/2021, 12:55 AMselect currency FROM transaction
on that account?Marc Reicher
03/19/2021, 12:56 AMtdietrich
03/19/2021, 12:56 AMtdietrich
03/19/2021, 12:57 AMMarc Reicher
03/19/2021, 12:57 AMtdietrich
03/19/2021, 12:59 AMMarc Reicher
03/19/2021, 12:59 AMselect currency FROM subsidiary
, but if you do a select * FROM subsidiary
I wonder if the currency field does in fact return. I also wonder if select * FROM currency
works loltdietrich
03/19/2021, 12:59 AMtdietrich
03/19/2021, 1:01 AMtdietrich
03/19/2021, 1:02 AMMarc Reicher
03/19/2021, 1:02 AMMarc Reicher
03/19/2021, 1:03 AMtdietrich
03/19/2021, 1:03 AMtdietrich
03/19/2021, 1:03 AMMarc Reicher
03/19/2021, 1:04 AMMarc Reicher
03/19/2021, 1:05 AMtdietrich
03/19/2021, 1:06 AMtdietrich
03/19/2021, 1:07 AMMarc Reicher
03/19/2021, 1:10 AM