带有文本字段输入的NetSuite对话框(SuiteScript 1.0)

问题描述 投票:1回答:2

我目前正在使用Suitescript 1.0,我们还没有实现2.0的飞跃,今年可能会非常好。但是,在此期间,我正在寻找有关如何使用用户输入创建对话框的建议。我看过SuiteAnswers并没有任何运气。

这可能是1.0吗?该功能可以在用户事件脚本中使用吗?你能提供例子或链接吗?

谢谢!

netsuite suitescript
2个回答
0
投票

不要认为有一个...您可能想要添加自定义HTML字段并显示正常提示。


1
投票

对于其他任何好奇我所做的人:我创建了一个内联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()");
© www.soinside.com 2019 - 2024. All rights reserved.