Has anyone successfully used the BUILTIN.HIERARCHY...
# suiteql
t
Has anyone successfully used the BUILTIN.HIERARCHY function? I have tried to get it to run on the customer table, but can not seem to get the correct joins in my select
This works for the Locations or Subsidiary table, but it will not work on the Customer table.
Copy code
select 
BUILTIN.HIERARCHY(parent,'SELF_DISPLAY'), 
* from location
t
I've had some luck with it in Account-related queries. Here's one. How effective it is depends on how the CoA is configured in the NetSuite instance.
Copy code
SELECT 
	ID,
	DisplayNameWithHierarchy, 
	Parent,
	BUILTIN.HIERARCHY( Parent, 'DISPLAY' ) AS DISPLAY,
	BUILTIN.HIERARCHY( Parent, 'DISPLAY_JOINED' ) AS DISPLAY_JOINED,
	BUILTIN.HIERARCHY( Parent, 'DISPLAY_SEPARATED' ) AS DISPLAY_SEPARATED,
	BUILTIN.HIERARCHY( Parent, 'IDENTIFIER' ) AS IDENTIFIER,
	BUILTIN.HIERARCHY( Parent, 'IDENTIFIER_SEPARATED' ) AS IDENTIFIER_SEPARATED,
	BUILTIN.HIERARCHY( Parent, 'LEVEL' ) AS LEVEL,
	BUILTIN.HIERARCHY( Parent, 'SELF_DISPLAY' ) AS SELF_DISPLAY,
	BUILTIN.HIERARCHY( Parent, 'SELF_IDENTIFIER' ) AS SELF_IDENTIFIER
FROM 
	Account 
WHERE 
	( Parent IS NOT NULL )
ORDER BY
	BUILTIN.HIERARCHY( Parent, 'LEVEL' ),
	DisplayNameWithHierarchy
t
Thank you for the response, I guess that BUILTIN is limited in it's usage.