有人知道在哪里可以找到SS2.0 JSDOC定义库吗? [英] Does anyone know where to find a SS2.0 JSDOC definition library?

查看:48
本文介绍了有人知道在哪里可以找到SS2.0 JSDOC定义库吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道或拥有我可以用于SS2.0的JSDOC定义库吗?

Does anyone know or has a JSDOC definition library I can use for SS2.0??

我目前拥有的SS1.0看起来像下面的那个,我用它插入我的IDE并获得自动补全功能.

The current one I have for SS1.0 looks like the one below, and I use it to plug into my IDE and get autocompletion.

/** * Loads an existing saved search. The saved search could have been created using the UI, or created using nlapiCreateSearch(type, filters, columns) in conjunction with nlobjSearch.saveSearch(title, scriptId). 
*<br>API Governance: 5 
* @param {String} recType [optional] - The record internal ID of the record type you are searching (for example, customer|lead|prospect|partner|vendor|contact). This parameter is case-insensitive. 
* @param {String} searchId - The internal ID or script ID of the saved search. The script ID of the saved search is required, regardless of whether you specify the search type. If you do not specify the search type, you must set type to null and then set the script/search ID. 
* @returns {nlobjSearch} nlobjSearch
* @since 2012.1 */ 
function nlapiLoadSearch(recType, searchId) { };

这不是一个技术性问题,但对每个人来说都会派上用场.

Not really a technical question but would come in handy for everyone.

推荐答案

您可以考虑我所做的事情,而无需下载其他插件.
如果您拥有SS2.0 API的副本,然后使用"@param"和"@type" JSDOC标记,则将能够启用代码帮助.
然后,每次您键入"CTRL" +"SPACE"时都会有建议.
除此之外,您的IDE还将提供每个功能的描述.
这就是您要做什么.


You may consider what I did which there is no need to download other plugins.
You will be able to enable the code assist if you have the copy of SS2.0 API and then use "@param" and "@type" JSDOC tag.
Then, there will be suggestion every time you type then 'CTRL' + 'SPACE".
Aside from that, your IDE will also provide description for each function.
So this is what will you do.


  1. 在您的NetSuite帐户上,下载SuiteScript 2.0 JavaScript文件.您可以通过在> Documents> Files> SuiteScripts>中nagaviting来执行此操作.然后,在屏幕的右侧,您将看到"SuiteScript 2.0 API"和"SuiteSCript 1.0 API"的链接.单击以下载SS2.0.
  2. 在Eclipse IDE上,为SS2.0创建一个新的JavaScript项目,或将其包含在您现有的项目中.
  3. 在您正在工作的项目上,右键单击,然后选择属性".在> JavaScript>包含路径下,然后在项目"子标签下,添加包含SS2.0 API的项目.
  4. 您现在将获得SS2.0对象文字API的代码帮助.这些是"N/log"和"N" util"模块.
  5. 接下来要为SS2.0的对象构造函数API(如"N/record"和"N/search"模块)启用代码辅助,我们应该在每个函数声明上添加"@param" JSDoc标记.

    因此,如果我们要在脚本中使用"N/record","N/search"和"N/error"模块,则在函数声明之前应有以下示例注释.但是请注意,它应该与"{[VALUE HERE]}"标签内的值和模块名称相匹配.还有注释部分和函数声明上的变量名称.

  1. On your NetSuite accoun, download the SuiteScript 2.0 JavaScript files. You can do this by nagaviting at >Documents>Files>SuiteScripts>. Then at right portion of your screen, you should see links for "SuiteScript 2.0 API" and "SuiteSCript 1.0 API". Click for SS2.0 to download.
  2. On Eclipse IDE, create a new JavaScript project for SS2.0 or include it on your existing project.
  3. Next on the project you are working, right click then select "Properties". Under >JavaScript>Include Path and then at "Projects" subtab, add the project where SS2.0 APIs are included.
  4. You will now have code assist for object literal APIs of SS2.0. These are 'N/log' and 'N'util' modules.
  5. Next to enable the code assist for object constructor APIs of SS2.0 like 'N/record' and 'N/search' modules, we should be adding "@param" JSDoc tag on each function declaration.

    So if we are going to use the 'N/record', 'N/search' and 'N/error' modules in our script, we should have below sample comments before function declaration. But please take note that it should match the value inside the "{[VALUE HERE]}" tag and the module name. Also the variable name on the comment section and function declaration.

/**
* Do something.
* 
* @param {record} objRec
* @param {search} objSearch
* @param {error} objError
* 
*/
function doSomething(objRec, objSearch, objError)
{
       //CODE HERE
}


您也可以在变量声明中使用"@type".下面是示例代码.


You may also use '@type' for your variable declaration. Below is the sample code.

/**
* Do something.
* 
*/
function doSomething()
{
       /*** @type record**/
       var recCustomerRefund = record.create(
            {
                type : 'customerrefund',
                isDynamic : true
            }); 
}

这篇关于有人知道在哪里可以找到SS2.0 JSDOC定义库吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆