JyotiRani
JyotiRani
@b-admike Your example work as expected, however i realized that the issue is with async call, my autogenerated number is result of db aync call response, so there, looks like...
Its the dash db connector. Here is the snippet of the method: var query = {where: {and:[{companyId:data.1},{itemType:'TASK'}]}}; Tasks.app.models.numgenerator.findOne(query, function(err, res){ if (err) return next(err); nextGenNum = res.itemPrefix + leftPad(res.nextSeqNumber, res.sizeRequired...
Here is complete function which fetches and then updates the field in db: function fetchGenNumberAndProceed(data, next, iType) { var query = {}; if(data.companyId) query = {where: {and:[{companyId:data.companyId},{itemType:iType}]}}; else query =...
@b-admike any further inputs on this?
Any update on this?
@dhmlau can you please help triage this issue?
@dhmlau i don't have a sample repo as of now, but it can be easily reproduced by e.g. writing a before save operation hook for a model and validate on...
"loopback": "^2.22.0", "loopback-boot": "^2.6.5", "loopback-component-explorer": "^5.0.0", "loopback-component-storage": "^3.2.0", "loopback-connector-dashdb": "^1.0.18", "loopback-connector-rest": "^2.1.0", "mqlight": "^2.0.2017062000", "multer": "^1.3.0", "serve-favicon": "^2.0.1", "strong-error-handler": "^2.0.0"
[example_exception_handling.zip](https://github.com/strongloop/loopback/files/1436692/example_exception_handling.zip) Attaching the example App. Please extract the zip and install npm modules. Example allows name should be less than 5 chars long in post request, if name is >5...
Thanks...its working as expected now!