As of April 12th, you must go to Progress SupportLink to create new support cases or to access existing cases. Please, bookmark the SupportLink URL and use the new portal to contact the support team.
I have the following business logic collection hook.
function onPostSave(request, response, modules) {
var logger = modules.logger;
if (request.body.Barcode === "None") {
logger.info(request);
var collectionAccess = modules.collectionAccess;
collectionAccess.collection('user').find({ "username": modules.requestContext.getAuthenticatedUsername() }, function (err, userColl) {
if (err) {
logger.error('Query failed: ' + err);
} else {
logger.info('Query success: ' + JSON.stringify(userColl));
logger.info(JSON.stringify(userColl));
modules.email.send('no-reply@slyk.com',
'michaelvowles571@gmail.com',
'Asset Tag notification',
'Asset tag needed for ' + userColl[0].Company +
', e: ' + userColl[0].email +
' p: ' + userColl[0].ContactNumber + '. Asset _id:' + response.body._id +
' Asset name: ' + response.body.AssetName +
' Asset OEM: ' + response.body.OEM,
function (err, result) {
if (err)
logger.error(err);
response.continue();
});
}
});
}
response.continue();
}
If I remove the `logger` call on the fourth line the script no longer works. However leaving it in makes it work how is this so?
Best Answer
P
Pranav J
said
almost 6 years ago
Michael,
The logger module gives you the ability to log data and access those logs. It is used to log a message that you can view in the console. It is just for testing purpose and not sure adding/removing it would affect code functionality or BL execution flow. For more info. please take a look at following links:
The logger module gives you the ability to log data and access those logs. It is used to log a message that you can view in the console. It is just for testing purpose and not sure adding/removing it would affect code functionality or BL execution flow. For more info. please take a look at following links:
Michael Vowles
I have the following business logic collection hook.
If I remove the `logger` call on the fourth line the script no longer works. However leaving it in makes it work how is this so?
The logger module gives you the ability to log data and access those logs. It is used to log a message that you can view in the console. It is just for testing purpose and not sure adding/removing it would affect code functionality or BL execution flow. For more info. please take a look at following links:
https://devcenter.kinvey.com/html5/tutorials/bl-getting-started#Logging
https://devcenter.kinvey.com/html5/reference/business-logic/reference.html#logger-module
Thanks,
Pranav
Pranav J
The logger module gives you the ability to log data and access those logs. It is used to log a message that you can view in the console. It is just for testing purpose and not sure adding/removing it would affect code functionality or BL execution flow. For more info. please take a look at following links:
https://devcenter.kinvey.com/html5/tutorials/bl-getting-started#Logging
https://devcenter.kinvey.com/html5/reference/business-logic/reference.html#logger-module
Thanks,
Pranav
-
How do I access query string values for GET and DELETE requests?
-
Basic Authentication in Business Logic
-
How do I cascade delete entities from related collections?
-
All BL failing with Violation Error
-
How do I send push notifications?
-
Whenever I try to query by _id, I get zero results
-
receiving SOCKETTIMEDOUT when requesting external http response
-
Unique Constraints on a collection column?
-
Need some help with grouping
-
Accessing Endpoint from Collection Hook
See all 342 topics