Anyone know a clever way (without N/record loading...
# suitescript
d
Anyone know a clever way (without N/record loading record) to find what custom fields are on the record? (assume you don't know the record)
b
d
Yah, got that far. But I can figure out if it's on a Sale Order or some other record type.
The "applies to" is not exposed
b
the easiest is basically what you dont want to do, use N/record to create a record
then get the fields from it
d
Yah, but performance can really suck in that case. I know I can do that but I REALLY don't want to.
b
im not really sure what makes that slow
but i guess the similar query alternative is a select * using suiteql
and hopefully add whatever condition and table is necessary to limit the results to your particular type
d
I'm tempted to just use jQuery and get the xml=t
m
If you are client-side you can call the records catalog internal endpoint
d
@michoel example? Not sure what you mean.
d
I ❤️ Tim D But..... that's not going to work either.
Not sure if this will work faster than a load so I'll have to test but this does work for what I'm looking to do...
Copy code
jQuery.get(location+'&xml=t',function(r){
    let xml=new XMLSerializer().serializeToString(r);
    console.log(xml);
    console.log(/_bluchat_mention/ig.test(xml));
})
e
I use the same methodology of loading the XML representation of the record via the browser and then parsing the XML.
👍 1