我可以有一个简单的 Suitelet 示例吗?

May I have a simple Suitelet example?

我正在通读 Suitescript 2.0 手册,只是想了解手册本身,更不用说 Suitescript 了。有人可以提供一个 suitelet 如何显示到 html 页面的简单示例吗?就像一个简单的 recordtype 记录字段值显示到网页上。感谢您的帮助。

我有一些示例可以帮助您开始使用一些流行的 Suitescript 2.0 类型,包括位于 ursuscode.com 的 Suitelets。检查出来。

这是 SS2.0

中的基本 "Hello World!" Suitelet
/**
 *@NApiVersion 2.x
 *@NScriptType Suitelet
 *@NModuleScope SameAccount
 */

define([], function() {
  function onRequest(params) {
    var html = '<h1>Hello World!<h1>';
    params.response.write({ output: html });
  }

  return {
    onRequest: onRequest
  };
});
/**
*@NApiVersion 2.x
*@NScriptType Suitelet
*/

define([],function() { // NetSuite's AMD pattern
    function onRequest_entry(context) { // Suitelet entry function receives a context obj
        context.response.write('Hello World'); // Write a response using the context obj
    }
    return {
        onRequest: onRequest_entry // Function assigned to entry point
    };
});