This topic contains 13 replies, has 0 voices, and was last updated by michoel 8 years, 5 months ago.
-
AuthorPosts
-
November 11, 2015 at 7:28 am #2084
elieWhere is the documentation for which fields are available or not in the Advanced PDF/HTML Templates? While working on the Sales Order, we would like to add the quantity back ordered field, and others. Any ideas?
This is a cached copy. Click here to see the original post. -
November 11, 2015 at 7:52 am #2085
cdelacruzPlease check the SuiteScript Records Browser in SuiteAnswers Article: Working with the SuiteScript Records Browser (Answer ID: 10511)
-
November 11, 2015 at 8:16 am #2086
elieI am familiar, thanks. I just realized that there is a Sales Order record, independent of the Transaction record in the Records Browser! It’s documented there, but not under the generic Transaction.
Thanks!
-
November 11, 2015 at 3:52 pm #2087
michoelIn addition to the Script Browser, there are some other ways for figuring out field names for use in scripts and PDF templates:Enable the ‘Show Internal IDs’ preference, and the Field IDs for body level fields will appear in the field help popup window.
Add the string ‘&xml=T’ to the end of the URL for the record to see the record in XML
Load the record in your browser console using nlapiLoadRecord() and examine the object returned -
May 27, 2016 at 9:55 pm #2088
rporteousHi elie
Originally posted by elie
View Post
Where is the documentation for which fields are available or not in the Advanced PDF/HTML Templates? While working on the Sales Order, we would like to add the quantity back ordered field, and others. Any ideas?
I discovered across in the LinkedIn NetSuite users group that had the best answer that works mostly for me..
Simply append this “&xml=t” to the end of any transaction in your browser, see this example from an estimate;
Before
After
Once this is done, you will see heaps of XML field names which can be referenced!
So for example you can find the XML field One Infinite Loop
Cupertino CA 95014 and use it like this in the your Advanced PDF/HTML Template.${record.billaddress}Which will render like this in a PDF document, where the
gives us a line break;One Infinite LoopCupertino CA 95014
I was searching for something like this for ages!
Russ
-
May 28, 2016 at 11:20 pm #2089
elieYes! If you look at the response from michoel earlier you will see other (even better at times) options as well, but this is great, definitely!!
-
May 29, 2016 at 7:40 am #2090
k_duncQuick question regarding michoel’s last point:
Load the record in your browser console using nlapiLoadRecord() and examine the object returned
What does this actually mean? How would one do this?
-
May 29, 2016 at 5:44 pm #2091
michoelHi k_dunc,
In Chrome, you can use the shortcut Ctrl + Shift + J to access the Developer Console, which allows you to interactively enter JavaScript expressions and examine the results. If you open it on a page that has loaded the NetSuite Client Side API, you can directly call Client Side API functions and see the output which I find to be a huge time saver in writing Netsuite scripts.
See the image below for an example of using nlapiLoadRecord() to explore the nlobjRecord and find all the available fields. (Keep in mind that some of these may be undocumented and therefore might break without notice in future updates).
-
May 29, 2016 at 6:41 pm #2092
k_duncWow! Thanks for that michoel. That’s great. Thanks for sharing.
-
May 31, 2016 at 3:58 pm #2093
elieThis is all great, but I have more information that I know is available via SuiteScript but am not sure how to approach retrieving that info via the templates.
For example, execution contexts. I want to retrieve the “system.netsuite.com” vs “system2” or “sandbox” – any ideas?
-
June 6, 2016 at 2:15 pm #2094
elieAnybody? I need some help, here. I would like to pull the environment from the execution context, at the very least. So, similar to context.getEnvironment in SuiteScript, or better even, because I’d rather the actual uri than the string “PRODUCTION” or “SANDBOX” – but I’m not sure how to even get that in the Freemarker Templates?
-
June 6, 2016 at 7:08 pm #2095
michoelelie I would also find this very useful. I’ve submitted a case to support and will let you know.
-
June 7, 2016 at 7:23 am #2096
dlindoresYou could try accessing companyInformation.logoUrl – this will contain the URI. You’ll need to find a way to perform logic on this, I’ve been trying to use the “contains” Freemarker built-in to check whether the link contains the word “sandbox” but this has been unsuccessful so far. Other options such as substrings might be the answer, but that should at least get you a step closer.
-
June 13, 2016 at 6:39 pm #2097
michoeldlindores – great that works perfectly! Not sure what error you are getting?
Code:
Sandbox Production
elie, support raised Enhancement #398152 for this, thought the above work around seems to work. -
AuthorPosts
You must be logged in to reply to this topic.