Getting JSON parse exceptino when calling formStart function

73 Views Asked by At

I'm trying to call the formStart function. I keep on getting the error "Error parsing JSON: SyntaxError: Unexpected end of JSON input". Any idea why? I'm using the basic example code on the priority github. Here is the function call code:

var priority = require('priority-web-sdk');
var configuration = {
    username: 'myusername',
    password: 'password',
    url: 'https://priority.my.server/',
    tabulaini: 'tabula.ini',
    language: 3,
    company: 'companyname'
};

priority.login(configuration)
  .then(()=> priority.formStart('CUSTOMERS', null, null, 'company', 1))
  .then(form=> form.getRows(1))
  .then(rows=> console.log(rows))
  .catch(err=> console.log(err));
1

There are 1 best solutions below

0
JRMedatechUK On

I am having a similar issue with the sdk if you try the below code and see if you get a result from the form as i think the getRows function isn't working as expected.

var priority = require('priority-web-sdk');
var configuration = {
    username: 'myusername',
    password: 'password',
    url: 'https://priority.my.server/',
    tabulaini: 'tabula.ini',
    language: 3,
    company: 'companyname'
};

priority.login(configuration)
  .then(()=> priority.formStart('CUSTOMERS', null, null, 'company', 1))
  .then(custForm=> console.log(custForm))
  .catch(err=> console.log(err));