JSDoc in SuiteScript 2.0

JSDoc in SuiteScript 2.0

As your NetSuite training provider and netsuite solution provider we come up with new blog which emphasize on JSDoc. Now in this netsuite training we are going to discuss more on JSDoc.

What is JSDoc?

JSDoc is a markup language used to annotate JavaScript source code files. Using comments containing JSDoc, programmers can add documentation describing the application programming interface of the code they’re creating. This is then processed, by various tools, to produce documentation in accessible formats.

Users typically employ this tool to generate an HTML API reference. In our NetSuite training Developers insert specific comment blocks into their source code. These comment blocks start with /** and end with */. These tags are prefaced with the @ symbol. The JSDoc tags are added to the comment blocks, and they are used to specify the various entities of a JavaScript file (for example, @param).

/**

 * Creates a file.

 * @param {string} name [required] – file name

 * @param {string} fileType [required] – file type

 * @param {string} contents [required] – file content

 * @returns {object} file.File

 */

JSDoc parses the source code for each comment block. The HTML output is then generated based on the content of the comment blocks and an evaluation of the code. JSDoc 3 also lets users create custom JSDoc tags. These tags can be defined to trigger events (for example, displaying a certain page).

 All netsuite training providers and netsuite solution provider not give emphasis to this part but for proper netsuite implementation it is important part of documentation.

SuiteScript 2.0 includes several custom tags, such as @NApiVersion and @NScriptType. Some of these tags are required in each entry point script uploaded to NetSuite

The available SuiteScript 2.0 JSDoc tags are as follows:

1.@NApiVersion possible values ( 2.0,  2.1,  2.x,  2.X)

For SuiteScript 2.0 entry point scripts, this tag is a required declaration. It indicates to NetSuite the SuiteScript version to use.

2. @NScriptType  possible values (UserEvent, Scheduled etc)

This tag identifies the type of script defined in the file.

3. @NModuleScope  possible values (SameAccount, TargetAccount, Public)

This tag is used to control access to scripts and custom modules

Reference : netsuite.com, netsuite help  and netsuite guide.

Feel free to reach out netsuite solution providernetsuite implementationnetsuite consultation , netsuite customizationnetsuite Support, netsuite Training  

contact us at:

Email : [email protected]

Facebook : https://www.facebook.com/Smiling-Coders-Netsuite-Training-Implementation-and-Support-1591053827660082/

Linkedin : https://www.linkedin.com/company/netsuite-academy/


Log out of this account

Leave a Reply