Learning to DEBUG in NodeRun


#1

I have had a wonderful afternoon working on my project. I have solved a lot of problems on my own but I need to learn to debug in the NodeRun IDE. I have looked at documentation and youTube for some HOWTO information that would explain this cryptic message on how to set up for debug.
image
If you can point me at something I bet I can figure it out… (Then again, maybe not. But I want to try before really bug you about it. )

Another question is about “key_someColumnName”, this is used in WHERE clauses of many of your CRUD examples. I just know you did not create some naming convention rule for prefixing with “key_” and yet I cannot find any reference to in either code of displays that would put some value for comparison. In the example below key_productLine is never declared or initializes??

// Prompt to delete and then delete the record
function deleteRecord(key_productLine) {
display.delete.execute();
if (btnYes) {
try {
pjs.query("DELETE FROM productlines WHERE productLine = ? ", key_productLine);
}
catch (err) {
displayMessage(“Product line " + key_productLine + " can not be deleted because it has products assigned.”);
}
}
}


#2

Hello David,

A couple things to note about the debugging. As the message says, you need to either have a route set up, or a JavaScript file specified at the application’s start file. Could you please confirm that you have one of the above two set up in your space?

A small thing to note, is that if your application start file is in the ‘public’ directory, then it will not count towards this requirement. This is because, the ‘public’ directory is for client side code that is sent to the end user when they launch the application. Because this client side code is sent to the end user, it is expected that you will debug it on the end user’s side, and therefore cannot be debugged from the noderun interface. To correct this you would need to move the server side code outside of the ‘public’ directory.

For your second question, in the example code you provided, ‘key_productLine’ is the name of the parameter defined in the function call. This means that what ever value you pass into the function when you call it will be stored in the variable ‘key_productLine’. Because the variable is defined in the function call, you will not see the typical variable declaration and initialization code.

Thanks,

Kyle Law
Technical Support Specialist
Profound Logic Software