带文本字段输入的 NetSuite 对话框 (SuiteScript 1.0)
NetSuite dialog box with text field input (SuiteScript 1.0)
我目前使用的是 Suitescript 1.0,我们还没有升级到 2.0,很可能在今年。但是,在此期间,我正在寻找有关如何创建带有用户输入的对话框的建议。我已经查看了所有 SuiteAnswers,但没有任何运气。
这在 1.0 中可行吗?
该函数可以在用户事件脚本中使用吗?
您能否提供示例或 link?
谢谢!
不认为有...您可能想要添加自定义 HTML 字段并显示正常提示。
对于其他对我做了什么感到好奇的人:
我创建了一个内联 HTML 字段并用它来推送下面的标准 JS 来测试我要找的东西。我发现它仅限于满足我的需求并且无法使用,但它可能对其他人有用。我所希望的是保留 person 变量并稍后在我的用户事件脚本中使用它以将其设置为视图模式中的字段值。但是无法将数据保存在变量中。
如果有人找到使用它并仍然检索该信息的方法,请告诉我。
正如我在对 felipechang 的回复中提到的,我创建了一个 suitelet 来完成我需要的所有操作。话虽如此,这是我最初测试的代码。我创建了一个名为 "Test" 的按钮,它会触发函数 onclick。
var inline_html = '<html>';
inline_html += '<body>';
inline_html += '<button onclick="myFunction()">Try it</button>';
inline_html += '<p id="demo"></p>';
inline_html += '<script>';
inline_html += 'function myFunction() {';
inline_html += 'var person = prompt("Please enter your name", "Harry Potter");';
inline_html += 'if (person != null) {';
inline_html += 'alert("Hello " + person + "! How are you today?");';
inline_html += '}';
inline_html += '}';
inline_html += '</script>';
inline_html += '</body>';
inline_html += '</html>';
nlapiSetFieldValue('custrecord_inline_html', inline_html);
form.addButton('custpage_revised', 'test', "myFunction()");
我目前使用的是 Suitescript 1.0,我们还没有升级到 2.0,很可能在今年。但是,在此期间,我正在寻找有关如何创建带有用户输入的对话框的建议。我已经查看了所有 SuiteAnswers,但没有任何运气。
这在 1.0 中可行吗? 该函数可以在用户事件脚本中使用吗? 您能否提供示例或 link?
谢谢!
不认为有...您可能想要添加自定义 HTML 字段并显示正常提示。
对于其他对我做了什么感到好奇的人: 我创建了一个内联 HTML 字段并用它来推送下面的标准 JS 来测试我要找的东西。我发现它仅限于满足我的需求并且无法使用,但它可能对其他人有用。我所希望的是保留 person 变量并稍后在我的用户事件脚本中使用它以将其设置为视图模式中的字段值。但是无法将数据保存在变量中。
如果有人找到使用它并仍然检索该信息的方法,请告诉我。
正如我在对 felipechang 的回复中提到的,我创建了一个 suitelet 来完成我需要的所有操作。话虽如此,这是我最初测试的代码。我创建了一个名为 "Test" 的按钮,它会触发函数 onclick。
var inline_html = '<html>';
inline_html += '<body>';
inline_html += '<button onclick="myFunction()">Try it</button>';
inline_html += '<p id="demo"></p>';
inline_html += '<script>';
inline_html += 'function myFunction() {';
inline_html += 'var person = prompt("Please enter your name", "Harry Potter");';
inline_html += 'if (person != null) {';
inline_html += 'alert("Hello " + person + "! How are you today?");';
inline_html += '}';
inline_html += '}';
inline_html += '</script>';
inline_html += '</body>';
inline_html += '</html>';
nlapiSetFieldValue('custrecord_inline_html', inline_html);
form.addButton('custpage_revised', 'test', "myFunction()");