Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected readMore results #7

Closed
kdmny opened this issue Mar 16, 2017 · 1 comment
Closed

Unexpected readMore results #7

kdmny opened this issue Mar 16, 2017 · 1 comment
Assignees

Comments

@kdmny
Copy link

kdmny commented Mar 16, 2017

This readyByQuery call:

const projectControlFunc = IntacctApi.readByQuery({
  object: "PROJECT",
  fields: "PROJECTID,RSEGMENT,NAME",
  query: "RSEGMENT IS NOT NULL",
  pagesize: 2
});

Returns 2 projects and the projects are accessible at the locator projectControlFunc.data.project:

ControlFunction {
  name: 'readByQuery',
  parse: [Function: read],
  parameters: 
   { query: 'RSEGMENT IS NOT NULL',
     fields: 'PROJECTID,RSEGMENT,NAME',
     pagesize: 2,
     returnFormat: 'xml',
     docparid: '',
     object: 'PROJECT' },
  controlId: 'f4e487f0-0a3d-11e7-8bc2-7dc14e8dce03',
  result: 
   { status: 'success',
     function: 'readByQuery',
     controlid: 'f4e487f0-0a3d-11e7-8bc2-7dc14e8dce03' },
  data: 
   { '$': 
      { listtype: 'project',
        count: '2',
        totalcount: '3075',
        numremaining: '3073',
        resultId: '7765623338WMp6r8CoA4oAAAdYmU4AAAAC5' },
     project: [ [Object], [Object] ] } }

This subsequent readMore call:

const nextFunc = IntacctApi.readMore({object: 'PROJECT'});

Only returns 1 project (expected the same pagesize of 2) and the locator of the project data is now nested in an array like projectControlFunc.data[0].project:

ControlFunction {
  name: 'readMore',
  parse: null,
  parameters: { object: 'PROJECT' },
  controlId: 'f5c59920-0a3d-11e7-8bc2-7dc14e8dce03',
  result: 
   { status: 'success',
     function: 'readMore',
     controlid: 'f5c59920-0a3d-11e7-8bc2-7dc14e8dce03' },
  data: [ { '$': [Object], project: [Object] } ] }

Is this expected? Am I using it properly?

kdmny added a commit that referenced this issue Mar 16, 2017
kdmny added a commit that referenced this issue Mar 16, 2017
mrlannigan added a commit that referenced this issue Mar 17, 2017
#8)

* Ability to create readMore controlFunctions from previous read queries

* #7 tests

* #7 tests
@mrlannigan
Copy link
Contributor

Closed by #8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants