https://netsuiteprofessionals.com logo
t

tech_ph2019

03/25/2022, 5:53 PM
are custom segments supported in suiteql? if yes, how do I reference it in the query?
t

tdietrich

03/25/2022, 7:07 PM
@tech_ph2019 You can get the IDs of the custom segments using this:
SELECT * FROM CustomSegment
Then use the "scriptid" as the table name to get values for a specific segment. For example:
Copy code
SELECT
	CUSTOMRECORD_CSEG1.ID,
	CUSTOMRECORD_CSEG1.Name,
	*
FROM 
	CUSTOMRECORD_CSEG1
t

tech_ph2019

03/25/2022, 7:24 PM
thanks @tdietrich! I will try that out
Hi @tdietrich your suggestion worked. Now I want to get the custom segment value from a record. I applied the custom segment to Budgets. I am doing select * from budgets and the custom segment column is not returning
t

tdietrich

03/25/2022, 10:21 PM
@tech_ph2019 There should be a mapping table between that maps the Budgets table to the custom segment. For example: SELECT mapone FROM MAP_customrecord_cseg1_cseg1_filterby_location To find the table name, you could use the SuiteQL Query Tool's Tables Reference.
t

tech_ph2019

03/25/2022, 10:37 PM
thanks!
n

NickSuite

03/26/2022, 4:52 PM
I have filed a defect for SuiteQL with Budget records. It was returning duplicate lines when every other field was same except the custom segment. It was a show stopper for the client but NetSuite has provided a date of 2023.2 release.
thanks 1
t

tech_ph2019

03/28/2022, 1:58 PM
@NickSuite May I know how you got to show the custom segment values from your budget query?
n

NickSuite

03/28/2022, 2:21 PM
If I remember correctly, I got the ideas from SuiteQL of the budget record and then used saved search.
FYI, I have 2 defects on Budget record with SuiteQL. Defect 653735 and 659820