I would like to run suitescript 2.0 on Chrome insp...
# suitescript
k
I would like to run suitescript 2.0 on Chrome inspect mode, Does anyone know how to do it?
m
Do you mean Chrome debugger. You can for client scripts and coming soon SS 2.1 server scripts
Easiest way is to add a`debugger;` statement in your code, but you can also find the code in the source tab and add a breakpoint
k
I mean I'd like to run script on Chrome Inspect Console
like we use 1.0
m
Ah gottya
k
something like this
message has been deleted
m
Copy code
require(['N/currentRecord'])
var currentRecord = require('N/currentRecord');
var currRecObj = currentRecord.get();
k
thanks
@michoel how can I run search with 2.0 on console?
do you have any idea?
m
Same thing, just change
currentRecord
to
search
k
I doesn't work on my side
var search = require(['N/search']);
var customrecord_billing_search = search.create({
type: 'customrecord_billing_ins',
columns: [
search.createColumn({
name: 'name',
summary: 'group',
sort: search.Sort.ASC
}),
search.createColumn({
name: 'internalid',
summary: 'group'
}),
search.createColumn({
name: 'internalid',
join: 'custrecord_billingintparent',
summary: 'count'
}),
search.createColumn({
name: 'custrecord_type',
summary: 'group'
}),
search.createColumn({
name: 'baseprice',
join: 'custrecord_item',
summary: 'group'
}),
search.createColumn({
name: 'custrecord2',
join: 'custrecord_billingintparent',
summary: 'count'
})
]
});
var searchResultCount = customrecord_billing_search.runPaged().count;
m
You have to call require twice, first time with an array second time without
k
I see
m
Copy code
require(['N/search']);
var search = require('N/search')
You could of course also use the require callback, but that is much easy with the snippet editor
message has been deleted
@Kevin Kelly you can save a snippet like this and load them quickly in the chrome console
👍 1
k
Thanks