0

I am using WebStorm to write SuiteScript code and the netsuite N/record module (I defined the module as record). I have a function I wrote that will return a record (below is a simplified form of it)

/**
 *
 * @returns {record.Record} record.Record
 */
function getRecord() {
    return rrecord.load({type: 'customrecordtc_login', id: recordId})
}

I am trying to use the JS doc so that it knows that this return is a Record object, i.e. if I called something like

r = getRecord()

I was hoping intelisence would know that I can use something such as

r.getText({...})

etc. But currently I can't get the JSDoc to do that.

Is that something possible and if so how?

The JSDoc that I put doesn't seem to direct it to Record object.

Is there an additional addon (I added in the suitecloud SDK plugin from NetSuite)?

Below is a screen shot of how my IDE looks in a given place and I wondered if there was a way to JSDoc to do something kind of similar with my own utils scripts (or their returns). (to add or change something so the IDE knows to treat a return from a utility function as a specific thing and let it auto complete. For example if I called x=utils.getSomeRecord(). and the IDE would be able to give tips for x. ** display .getField etc. like above screen shot)

enter image description here

jvoigt
  • 400
  • 4
  • 23
  • Suite Script will not work like that. You need to use the format/template that is its standard. So I am here adding link for reference of samples, Go to step by step to create the script in netsuite. https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_1503717063.html – SuiteStar Feb 08 '23 at 16:21
  • I understand how to make and deploy scripts as I have done some of it. What I am trying to do is see if there is a way that I can leverage WebStorm to help with the tips of what kind of functions etc. a variable can have. – jvoigt Feb 09 '23 at 20:25

0 Answers0