0

I am new to Webpos in Openbravo and have been given to load the data from server to client using Javascript. I have written the following code - clientsidemodel.js. but, when i run in Webpos terminal I am encountering the following error:

Uncaught SyntaxError: Invalid or unexpected token and appending characters like ​ ​.

var ServeOption = OB.Data.ExtensibleModel.extend({
        modelName: 'ServeOption',
        tableName: 'ServeOption',
        entityName: 'ServeOption',
        modelFunc: 'ServeOption',
        source: 'com.promantiatraining.webpos.ServeOption',
        dataLimit: 300
    });

ServeOption: addProperties([{
    name: 'id',
    column: 'id',
    primaryKey: 'true',
    type: 'TEXT'
}, {
    name: 'name',
    column: 'name',
    text: 'TEXT'
}, {
    name: 'description',
    column: 'description',
    type: 'TEXT'
}, {
    name: 'TMOptioncategory',
    column: 'tmOptioncategory',
    type: 'TEXT'
}, {
    name: '_identifier',
    column: '_identifier',
    type: 'TEXT'
}]);
OB.Data.Registry.registerModel(ServeOption);
OB.OBPOSPointOfSale.Model.PointOfSale.prototpe.models.push(ServeOption);

OB.Model.Product.addProperties([{
    name: 'TMOptionCategory',
    column: 'tmOptioncategory',
    type: 'TEXT'
}]);
​ ​
James Z
  • 12,209
  • 10
  • 24
  • 44
  • 3
    With a quick peek, you've two `\u200b` characters after `OB.Model.Product.addProperties` call. Remove the line after the function call. Those characters are often coming along copy-pasting code from a web page. – Teemu Feb 27 '18 at 11:07
  • Related : https://stackoverflow.com/questions/7055600/u200b-zero-width-space-characters-in-my-js-code-where-did-they-come-from – Aaron Feb 27 '18 at 16:27

0 Answers0