user6035236
user6035236

Reputation: 25

SuiteScript 2.0 Intellisense create search filter

I'm just starting out with suitescript, and I was wondering how to get the intellisense to work in suitescript 2.0 on creating a saved search. I know this is easy to do on the netsuite UI but I would like to learn how to do it in Suitescript. Here is example code below. I'm trying to use ctrl + space to show options on the Customer type. I've tried adding ['N/record'] and it gave me options on records.Type.(here were the options) but I can't get it to give me anything inside the filter single quotes.

define(['N/search'],

function(search) {
var MYsearch = search.create({
    type: search.Type.CUSTOMER, 
    title: 'My Customer search',
    filters: ['', '', '']       // here is where i want intellisense
})

as a side question: Does anyone know a good place for suitescript 2.0 questions and answers? stackoverflow seems to be lacking. I'm assuming because it's pretty much brand new. (I know of all the tutorials on the help center and SuiteAnswers) Thanks for the help!

UPDATE: It looks like Netsuite 2.0 doesn't like Internal IDs... hope that helps.

Upvotes: 1

Views: 1851

Answers (2)

Matthew Hendricks
Matthew Hendricks

Reputation: 11

I usually just create an array for filters, and another for columns, then add my filters to that array like sovar arrFilters = []; arrFilters.push(search.createFilter({ name: 'mainline', operator: search.Operator.IS, values: ['F'] })); arrFilters.push(search.createFilter({ name: 'trandate', operator: search.Operator.WITHIN, values: 'lastMonth', }));

var arrColumns = [];

    // invoiceid
    arrColumns.push(search.createColumn({
        name: 'internalid',
        join: 'appliedtotransaction'
    }));

Then you can just use your

search.create({ type: search.Type.VENDOR_PAYMENT, filters: arrFilters, columns: arrColumns });

Upvotes: 1

Leibnitz Jacquard
Leibnitz Jacquard

Reputation: 469

Hope this helps.

  1. Download the latest SuiteCloud Developer IDE or the Eclipse Mars version (just make sure you have downloaded SuiteCloud plugin SuiteCloud IDE - http://system.netsuite.com/download/ide/update_e4). With this IDE, you will be able to have API code assist for SuiteScript 1.0. However, there is other setup to enable it for SuiteScript 2.0. Also, this will enable you to have intellesense for native fields.
  2. Then if you want to include custom fields/columns, setup your master password at main menu >Netsuite>Master Password>.
  3. Get the list of your accounts from the production, sandbox, and beta environment. Do this at main menu >Netsuite>Manage Account>. If you will be added to a new customer account later, you need to add it manually by doing this step again to reflect it.
  4. Now, you need to connect your project folder to NetSuite account. But first, check the project setting by right clicking to the project folder>NetSuite>Change Project Settings>. Then, make sure you will be using the correct account.
  5. Then log-in to the account by right clicking the project folder >NetSuite>Log in to Project Account>. Once successfully logged-in.
  6. Finally, right click again the project folder >NetSuite>Sync Script IDs from Account>. Follow the instructions and select record type and fields.

Upvotes: 0

Related Questions