This topic contains 6 replies, has 0 voices, and was last updated by chanarbon 7 years, 11 months ago.
-
AuthorPosts
-
November 28, 2016 at 1:52 pm #1473
CFongIs there a way to test SS 2.x script calls from the browser console?
This is one of my favorite features of SS 1.0
The ‘debug’ feature of NetSuite is fine, but it’s kinda cumbersome when you want to quickly test an idea.
This is a cached copy. Click here to see the original post. -
November 28, 2016 at 2:39 pm #1474
david.smithI don’t think it’s officially supported but you can use this method:
Code:
require([‘N/record’,’N/search’],
function(record,search){
var s=search.create({ filters:[], columns:[], type:’inventoryitem’ });
s.run().each(function(result){ console.log(result); return true; });
var r=record.load({type:’inventoryitem’,id:15941});
console.log(r);
}
);
erictgrubaugh replied on 11/28/2016, 03:01 PM: Yep, all you do is wrap whatever 2.0 code you want to run in a `require` callback.
-
November 28, 2016 at 3:38 pm #1475
michoelFor ad-hoc debugging you can use the Chrome Developer Tools “Snippets” feature (note this needs to be run on a page with record in Edit mode):
For debugging existing scripts, you can insert a JavaScript “debugger” statement into the code to create a breakpoint,
Alternatively you can “require” the module in the browser console, inspect the resulting object and click “Show Function Definition” to open the source, and add the breakpoints there.
CFong replied on 11/28/2016, 04:49 PM: There isn’t, yet, a way to check it on a *view* mode record?
-
November 28, 2016 at 4:48 pm #1476
CFongThumbs up to all of you! Thank you so much! all of these tips are invaluable to a SS and JavaScript newbie like myself!
-
November 29, 2016 at 5:45 pm #1477
chanarbonYou may use snippets feature also in View mode for snippets which are not interacting with the current record like setting the values and the the change visible right away like the snippet that David showed above
-
December 9, 2016 at 11:51 am #1478
CFongchanarbon So the “snippets” will still work so long as I don’t want to “update” the values, correct?
-
December 18, 2016 at 7:29 pm #1479
chanarbonHi @CFong,
Yes. it should still be working with that kind of scenario.
-
AuthorPosts
You must be logged in to reply to this topic.