Hi everyone, I'm trying to query Tax codes (SalesT...
# general
a
Hi everyone, I'm trying to query Tax codes (SalesTaxItem) via SuiteQl and facing trouble in filtering by subsidiary. Getting this error
Copy code
Invalid search query. Detailed unprocessed description follows. Search error occurred: Field 'subsidiary' for record 'salesTaxItem' was not found. Reason: NOT_EXPOSED - Not available for channel SEARCH\n.
On Netsuite Tax codes record page I can see subsidiary is present but I'm not able to query.
s
I'm pretty sure we can resolve this issue with "join"
a
I checked record catalog for SalesTaxItem, could'nt find JOIN with subsidiary
s
Could you pls provide more context? what is this query supposed to do?
query Tax codes?
a
query Tax codes?
Yes Query:
Copy code
SELECT
			SalesTaxItem.id,
			SalesTaxItem.itemid,
			SalesTaxItem.taxtype AS taxtypeid,
			BUILTIN.DF(SalesTaxItem.taxtype) AS taxtypename,
			SalesTaxItem.taxaccount AS taxaccountid,
			BUILTIN.DF(SalesTaxItem.taxaccount) AS taxaccountname,
			SalesTaxItem.taxagency AS taxagencyid,
			BUILTIN.DF(SalesTaxItem.taxagency) AS taxagencyname,
			SalesTaxItem.externalid,
			SalesTaxItem.includechildren,
			SalesTaxItem.city,
			(TO_NUMBER(SalesTaxItem.rate) * 100) as rate,
			SalesTaxItem.description,
			SalesTaxItem.displayname,
			'netsuite' AS sourcesystem,
			'Percentage' AS amounttype,
			(CASE SalesTaxItem.isinactive WHEN 'T' THEN 'inactive' ELSE 'active' END) as status
		FROM
			SalesTaxItem
		ORDER BY
			SalesTaxItem.id`
s
Let me check on my side. Just a sec
even if it appears on the record page, we can not query since that is not the field of the salestaxitem table.
a
Yeah exactly
Currently we deploy a script for integration. I will utilize that to expose endpoint and do a record search. This is only solution I can think of
s
I think subsidiary is not a mandatory field, right?
a
It's not mandatory, but we are facing issues with a client having separate tenants for subsidiary, they end up selecting wrong tax then sync fail
s
Are you using Celigo? or
I mean in terms of Integraion app
a
No, We have developed our own integration package
s
we can use another approach. just use record.load(), record.getValue()
using restlet, right?
a
Yes, correct
s
Then record.load('type':'salextaxitem','id':""), record.getValue({fieldId:'subsidiary'})
make sense?
a
Yes, got it I'll use this approach
Thanks for the help 🙌
s
It's my pleasure. Feel free to DM if you have any issues.
🙌 1