使用标签的 Netsuite 客户端脚本
Netsuite client scripting using tags
我正在尝试在客户端脚本 pageInit 函数中使用 ol 和 ul 标签,通过脚本将它们应用到 netsuite 中的文本框,它们被应用到文本框,但记录打印抛出错误
function pageInit()
{
var nCustomForm = nlapiGetFieldText('customform');
if(nCustomForm == 'Flow Quote Form')
{
var nFlowQuote = '<ol><li>Example text</li></ol>';
nlapiSetFieldValue('custbody_ed_introduction', nFlowQuote);
}
}
需要帮助。
您是否已验证 nCustomForm 确实具有该值?
我经常做这种事情,但我确保我的内联文本字段在服务器上设置了一些默认值 html,然后我使用 jQuery 查找并设置值:
例如确保 custbody_ed_introduction 是一个内联 html 类型的字段并且具有类似于
的值
<div id='ed_intro_content'></div>
您可以将其设置为字段上的默认值或使用加载前用户事件脚本。然后在你的 pageInit 脚本中
if(nCustomForm == 'Flow Quote Form'){
$('#ed_intro_content').append($('<ol><li>Example text</li></ol>'));
}
我正在尝试在客户端脚本 pageInit 函数中使用 ol 和 ul 标签,通过脚本将它们应用到 netsuite 中的文本框,它们被应用到文本框,但记录打印抛出错误
function pageInit()
{
var nCustomForm = nlapiGetFieldText('customform');
if(nCustomForm == 'Flow Quote Form')
{
var nFlowQuote = '<ol><li>Example text</li></ol>';
nlapiSetFieldValue('custbody_ed_introduction', nFlowQuote);
}
}
需要帮助。
您是否已验证 nCustomForm 确实具有该值? 我经常做这种事情,但我确保我的内联文本字段在服务器上设置了一些默认值 html,然后我使用 jQuery 查找并设置值:
例如确保 custbody_ed_introduction 是一个内联 html 类型的字段并且具有类似于
的值<div id='ed_intro_content'></div>
您可以将其设置为字段上的默认值或使用加载前用户事件脚本。然后在你的 pageInit 脚本中
if(nCustomForm == 'Flow Quote Form'){
$('#ed_intro_content').append($('<ol><li>Example text</li></ol>'));
}