Hi. Has anyone had any success in getting around t...
# suiteql
s
Hi. Has anyone had any success in getting around the maximum column names in SuiteQL? Annoyingly some of our custom column names are rather long, and querying for a name such as 'custcol_tss_update_billing_record' returns 'custcol_tss_update_billin#' in the results. As i'm using the results to feed a sublist this is obviously failing, any way around this rather than me coding in some substitutions on the client end? Cheers
m
I have the same issue but no solution unfortunately, would be good to be able to get metadata from a record. This is also tricky because it is not allowed to use the shortened name in a select.
s
Good to know i'm not the only one! I will have to roll with a correction in the script for now
t
@Sam L I think SuiteQL's maximum column name length is 25 characters, and beyond that it does the truncation that you described. That can cause us all kinds of problems. What you might want to do is alias the custom columns, and do it in a consistent way so that you can handle it somewhat programmatically. For example, you might take the "custcol_" prefix off of your column names to get shorter aliases. So "custcol_tss_update_billing_record" becomes "tss_update_billing_record."
s
Thanks Tim - I think this is the best solution, just lengthens my code somewhat! I was using the query column names as a base to update a sublist with the same columns (timesheet) so its annoying that I have to put some code to handle the names inside the loops - oh well, first world problems! Thanks both
t
You're welcome. One more thing: With regards to custom tables and fields, there are some "meta" tables that we can access. For example:
Copy code
SELECT * FROM CustomRecordType
SELECT * FROM CustomField
There are others as well, such as CustomList, CustomTransactionType, and so on.
s
I was looking for that earlier actually, wondered if I could somehow link a table such as CustomField to grab the complete column name - but I dont think that would work.
The other solution is to just rename the field - I didnt make them though, and i bet they're used on tons of scripts!
t
Yikes. Yeah, I'd avoid that.
I wish we had a way to create views.
I'll call my friend Evan later and see if he can make that happen for us in the 2021.2 release. 🙃
m
do it ablobsunglasses
t
Should I ask for anything else? Free developer accounts?
m
free beer
s
haha - knowing "Even" (I don't, but have met him) he would definitely understand the pain of not having control over the views and probably do something about it - seemed like a tech-orientated guy
t
On a more serious note, wouldn't it be nice of they had a developer evangelist that we could run these types of things by? 😐
s
Yeah same, I guess they would be bombarded by questions.
m
no-one working at ns in this channel?
s
Not in this one, but I have seen someone from the SDF team commenting in this slack so there must be some