【问题标题】:NetSuite dialog box with text field input (SuiteScript 1.0)带有文本字段输入的 NetSuite 对话框 (SuiteScript 1.0)
【发布时间】:2019-02-06 18:54:15
【问题描述】:

我目前正在使用 Suitescript 1.0,我们还没有升级到 2.0,今年可能会很好。但是,在此期间,我正在寻找有关如何使用用户输入创建对话框的建议。我查看了所有 SuiteAnswers,但没有任何运气。

1.0 版可以吗? 该函数可以在用户事件脚本中使用吗? 能否提供示例或链接?

谢谢!

【问题讨论】:

    标签: netsuite suitescript


    【解决方案1】:

    对于其他对我做了什么感到好奇的人: 我创建了一个内联 HTML 字段,并用它来推送下面的标准 JS 以测试我正在寻找的内容。我发现它仅限于我的需求并且无法使用,但它可能对其他人有用。我希望的是保存 person 变量并稍后在我的用户事件脚本中使用它来将其设置为视图模式下的字段值。但是,无法将数据保存在变量中。

    如果有人找到使用它的方法并且仍然检索到该信息,请告诉我。

    正如我在对 felipechang 的回复中提到的,我创建了一个套件来执行我需要的所有操作。话虽如此,这是我最初测试的代码。我创建了一个名为“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()");

    【讨论】:

      【解决方案2】:

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

      【讨论】:

      • 感谢您的反馈,我赞成您的回复,因为它是准确的,但只完成了我需要的一半。不幸的是,我需要从内联 HTML 字段中传回一个变量。 (我之前没有提到这一点,因为我认为我能够检索变量并继续使用它。) 反过来,我必须做的是重定向到后端套件并从那里去。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-08-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-22
      • 2011-05-22
      • 2010-09-23
      相关资源
      最近更新 更多