Rephrasing this question, Is it possible to modify...
# suitescript
s
Rephrasing this question, Is it possible to modify the <title> HTML attribute for pages on Netsuite? Ex/ Having an SO show the SO# on the tab instead of "Sales Order-Netsuite...."
m
I've done this with an
inlinehtml
field added in
beforeLoad
that has some script in it - essentially super low-level DOM hacking. Set the default value to something like
<script>top.document.title=[your title here]</script>
.
s
Interesting. Ok ill look into that. Thanks 🙂
👍 1
n
Here is a UE script for doing this:
/**
* @NApiVersion 2.1
* @NScriptType UserEventScript
*/
define(['N/record','N/runtime','N/ui/serverWidget'],
function(record,runtime,serverWidget) {
function beforeLoad(context) {
var recordNumber = context.newRecord.getValue({'fieldId':'tranid'});
var fldPageTitleHTML = context.form.addField({
'id':'custpage_page_title_html',
'type':serverWidget.FieldType.INLINEHTML,
'label':'Page Title HTML'
});
fldPageTitleHTML.defaultValue = '<script>top.document.title=\'' + recordNumber + ' - NetSuite\'</script>';
}
return {
beforeLoad: beforeLoad
};
});
👀 1