<@UNXTRLABH> is this a custom field or a standard ...
# general
p
@Seth Duda is this a custom field or a standard field? Either way it should be possible e.g.
record.entity.id
from the main supplier field on a Purchase. However, I have experienced a few times where NS can be funny about bringing values through from a custom field.
s
Thanks!
@PenguinsOfDoom @jen Here's another interesting find - currency amount fields when printed on a PDF will add a currency symbol and commas. I always assumed the variable in the template was a string. However, they act like numbers in the template if you try to add/subtract/compare to another number.
p
@Seth Duda this is true in most cases but not all.
line.charge
and
line.payment
in Statement layouts do not act as numbers unless you assign them as variables and then use that variable for calculation. That one had me tearing my hair out for a good while when I first came across it.
s
It's really too bad NS doesn't give you more insight into the entire data structure that's available to templates...
p
You may find this interesting as it does give you quite an insight into the data structure. https://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2019_2/script/record/itemfulfillment.html You may also wish to install the chrome addon NetSuite Field Explorer which gives you a dynamic look into the record structure from the record page. https://chrome.google.com/webstore/detail/netsuite-field-explorer/cekalaapeajnlhphgdpmngmollojdfnd?hl=en
s
Thanks - yeah, in terms of fields/relationships, that's a good resource.
Random question for you - do you have any experience rendering templates via suitescript?
I've run into this issue a number of times, but I can't imagine there are a ton of folks trying to do this - if you render a template via suitescript and provide a NS record as a source, the template will sometimes be able to access dynamically added sublists (meaning sublists added on the fly by a User Event script) and othertimes it will act as if the sublist doesn't exist. I've decided it's some sort of timing issue the NS side since it will randomly work once and a while when you try a few times.
p
I have some experience with this, mainly for custom records so a script is run to generate an object that can be referenced by the template. Is that what you are trying to do?
s
Might be similar - something like this:
var objRecord = record.load(...); var rend = render.create(); rend.addRecord('record', objRecord); rend.renderAsString();
Basically, if that record being loaded has a user event script deployed, and the user event script adds a sublist beforeLoad, sometimes the template renderer can see the sublist, and sometimes it cant
Just been annoying me for a while!
p
Nope sorry, haven't done anything like that.
s
No worries, it's definitely seems like an edge case.