Giter Site home page Giter Site logo

intacct / intacct-sdk-js Goto Github PK

View Code? Open in Web Editor NEW
22.0 12.0 30.0 5.86 MB

Official repository of the Sage Intacct SDK for JavaScript in Node.js

Home Page: https://developer.intacct.com/tools/sdk-node-js/

License: Apache License 2.0

TypeScript 100.00%
intacct nodejs sage-intacct typescript javascript

intacct-sdk-js's People

Contributors

atul-sadhu-sage avatar dylan-holt-sage avatar intacctcoleenho avatar jimmymcpeter avatar mottykohn avatar nagboranna avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

intacct-sdk-js's Issues

v2.1.0 Minor release fixes

Large responses not processed
Query descending direction for orderby not working.
Fix PurchaseTransactionsDecline and Approve

Support for PROJECT_RULES in Project Create/Update/Read?

Hi,

I'm trying to make use of the PROJECT_RULES field (according to https://developer.intacct.com/api/project-resource-mgmt/projects/ ), but it looks like the Node.js SDK currently does not support this field yet.

Looking at Functions/Projects/ProjectCreate.js we can see that it supports the nested fields of CONTACTINFO, BILLTO and SHIPTO, but not PROJECT_RULES currently (the only remaining nested field based on the doc).

Is there a plan to add this support soon?

Thanks,

Bigi

Query function does not return same result format as Read with nested object

Trying to search offer the ability to search for contacts off recordNumber, contactName and return specified fields, but when I perform the search using the Read function I get

{
  RECORDNO,
  CONTACTNAME,
  MAILADDRESS: {
    ADDRESS1,
    ADDRESS2,
    CITY,
    STATE,
    ZIP
  }
}

While using a query that searches for the exact same fields returns

{
  RECORDNO,
  CONTACTNAME
  MAILADDRESS.ADDRESS1,
  MAILADDRESS.ADDRESS2,
  MAILADDRESS.CITY,
  MAILADDRESS.STATE,
  MAILADDRESS.ZIP
}

Is it possible to increase the Document Sequence Information for a record type via the SDK?

Is it possible for the SDK to edit the next number in a document sequence? I know it's possible to do it via the UI by going Company > Setup > Settings > Document numbering.

We have have a business need to be able to insert customer records with a supplied customer ID on creation, but also need to support letting Intacct generate the next available number at times.

We are running into an issue where if we supply a customer ID, even when the ID is the next number sequentially, the automated sequencing information isn't updated in Intacct. Being able to manually tell Intacct what the next number should be through the SDK would be a work around, albeit a bit clunky.

No function for Get support for filtering GetList?

Hello -

I've been trying to figure out how to get an attachment ID after using Functions.Company.AttachmentsCreate() in order to assign the attachment ID to an AP Bill. This function does not return the attachementId and the "supdoc" object type isn't available through the Read() function.

The only way I can see to get the attachment ID is through the GetList() function at Functions.Common.GetList, which isn't in the documentation but I found by browsing through the repo. This function does not appear to support filtering? Is there a Get() function on the horizon, or support for filters in GetList()?

The GetList() function works and I'm able to retrieve the attachment ID and correctly update the Bill, but it will get out of hand pretty quickly without support for filtering as it returns all attachments.

Essentially I'm looking for the following in the SDK:
https://developer.intacct.com/api/company-console/attachments/#get-attachment-by-id-legacy

Or am I totally missing the recommended way to get details for an attachment?

Thanks!

DimensionRestrictedDataGet function removed?

When updating node.js intacct SDK from 2.1.1 to 2.2.1 seems we've lost the DimensionRestrictedDataGet function.

Was this done intentionally and how can we go about getting this data now?

image001

ReadByName does not work properly

When running IA.Functions.Common.ReadByName() on object name 'CONTACT' and providing the 'CONTACTNAME' I get zero results.

When running IA.Functions.Common.ReadByQuery() on object name 'CONTACT' and providing the following query "CONTACTNAME = 'ExampleContact'", I get the record I was looking for.

What is the difference between these two query types?

const query = new IA.Functions.Common.ReadByName();
    query.objectName = 'CONTACT';
    query.names = ['ExampleContact'];
    query.fields = ['*'];
const query = new IA.Functions.Common.ReadByQuery();
    query.objectName = 'CONTACT';
    query.fields = ['*'];
    query.query = new IA.Functions.Common.Query.QueryString("CONTACTNAME = 'ExampleContact'");

Please support client-side

Current intacct-sdk-js has a dependency on a number of Node.js-specific core modules such as net, tls, fs, and others.

My app intentionally wants to do a fat-client implementation, so it needs to work in the browser.
Unfortunately currently it is not possible.

If possible, the current SDK needs to be isomorphic and work in both client-side and server-side JS.

Example errors are attached below:

As we can see, the only directly offending file is ProfileCredentialProvider.js and AttachmentFile.js, otherwise those are in the libraries request-promise-native library.

I am not sure if after fixing these errors no new errors would appear, but I am really looking forward to developing my web app without resorting to server-side logic!

ERROR in ProjectDir/node_modules/@intacct/intacct-sdk/dist/Credentials/ProfileCredentialProvider.js
Module not found: Error: Can't resolve 'fs' in 'ProjectDir\node_modules\@intacct\intacct-sdk\dist\Credentials'
 @ ProjectDir/node_modules/@intacct/intacct-sdk/dist/Credentials/ProfileCredentialProvider.js 20:11-24
...

ERROR in ProjectDir/node_modules/@intacct/intacct-sdk/dist/Functions/Company/AttachmentFile.js
Module not found: Error: Can't resolve 'fs' in 'ProjectDir\node_modules\@intacct\intacct-sdk\dist\Functions\Company'
 @ ProjectDir/node_modules/@intacct/intacct-sdk/dist/Functions/Company/AttachmentFile.js 20:11-24
...

ERROR in ProjectDir/node_modules/request/lib/har.js
Module not found: Error: Can't resolve 'fs' in 'ProjectDir\node_modules\request\lib'
 @ ProjectDir/node_modules/request/lib/har.js 3:9-22
 @ ProjectDir/node_modules/request/request.js
 @ ProjectDir/node_modules/request/index.js
 @ ProjectDir/node_modules/request-promise-native/lib/rp.js
 @ ProjectDir/node_modules/@intacct/intacct-sdk/dist/Xml/HttpClientHandler.js
...

ERROR in ProjectDir/node_modules/forever-agent/index.js
Module not found: Error: Can't resolve 'net' in 'ProjectDir\node_modules\forever-agent'
 @ ProjectDir/node_modules/forever-agent/index.js 6:10-24
 @ ProjectDir/node_modules/request/request.js
 @ ProjectDir/node_modules/request/index.js
 @ ProjectDir/node_modules/request-promise-native/lib/rp.js
 @ ProjectDir/node_modules/@intacct/intacct-sdk/dist/Xml/HttpClientHandler.js
...

ERROR in ProjectDir/node_modules/tough-cookie/lib/cookie.js
Module not found: Error: Can't resolve 'net' in 'ProjectDir\node_modules\tough-cookie\lib'
 @ ProjectDir/node_modules/tough-cookie/lib/cookie.js 32:10-24
 @ ProjectDir/node_modules/request-promise-native/lib/rp.js
 @ ProjectDir/node_modules/@intacct/intacct-sdk/dist/Xml/HttpClientHandler.js
...

ERROR in ProjectDir/node_modules/tunnel-agent/index.js
Module not found: Error: Can't resolve 'net' in 'ProjectDir\node_modules\tunnel-agent'
 @ ProjectDir/node_modules/tunnel-agent/index.js 3:10-24
 @ ProjectDir/node_modules/request/lib/tunnel.js
 @ ProjectDir/node_modules/request/request.js
 @ ProjectDir/node_modules/request/index.js
 @ ProjectDir/node_modules/request-promise-native/lib/rp.js
 @ ProjectDir/node_modules/@intacct/intacct-sdk/dist/Xml/HttpClientHandler.js
...

ERROR in ProjectDir/node_modules/forever-agent/index.js
Module not found: Error: Can't resolve 'tls' in 'ProjectDir\node_modules\forever-agent'
 @ ProjectDir/node_modules/forever-agent/index.js 7:10-24
 @ ProjectDir/node_modules/request/request.js
 @ ProjectDir/node_modules/request/index.js
 @ ProjectDir/node_modules/request-promise-native/lib/rp.js
 @ ProjectDir/node_modules/@intacct/intacct-sdk/dist/Xml/HttpClientHandler.js
...

ERROR in ProjectDir/node_modules/tunnel-agent/index.js
Module not found: Error: Can't resolve 'tls' in 'ProjectDir\node_modules\tunnel-agent'
 @ ProjectDir/node_modules/tunnel-agent/index.js 4:10-24
 @ ProjectDir/node_modules/request/lib/tunnel.js
 @ ProjectDir/node_modules/request/request.js
 @ ProjectDir/node_modules/request/index.js
 @ ProjectDir/node_modules/request-promise-native/lib/rp.js
 @ ProjectDir/node_modules/@intacct/intacct-sdk/dist/Xml/HttpClientHandler.js
...

i 「wdm」: Failed to compile.

Error from chokidar (C:\): Error: EBUSY: resource busy or locked, lstat 'C:\hiberfil.sys'
Error from chokidar (C:\): Error: EBUSY: resource busy or locked, lstat 'C:\pagefile.sys'
Error from chokidar (C:\): Error: EBUSY: resource busy or locked, lstat 'C:\swapfile.sys'

Remove exceptions for elements missing in control block response

For example, the following response to an old demo company:

<?xml version="1.0" encoding="UTF-8"?>
<response>
    <control>
        <status>failure</status>
        <senderid></senderid>
        <controlid></controlid>
    </control>
    <errormessage>
        <error>
            <errorno>PL04000055</errorno>
            <description></description>
            <description2>This company is a demo company and has expired.</description2>
            <correction></correction>
        </error>
    </errormessage>
</response>

will throw an exception because the uniqueid element is missing.

Error with AccountsReceivable.CustomerUpdate but not in XML API

I am attempting to follow the example to update a customer record to simply change the "comments" field via the example provided here https://github.com/Intacct/intacct-sdk-node-js-examples/blob/master/crud-customer.js

However it keeps throwing "BL04002055 Smart Rule CUST_REQ_TAXABLE Violated The Taxable field (Additional info tab) must be checked. [Support ID: 7lGI7EB030%7EYTuKDP0g2Pw--dgW6G9JxgAAAAI]". I'm not setting TAXABLE or any fields that would affect this smart rule. And this does not error when I use the Update Customer XML API directly.

My code

const updateFn = new IA.Functions.AccountsReceivable.CustomerUpdate();
updateFn.customerId = 'TESTCUSTOMER',
updateFn.comments = 'test - ' + Math.floor(Math.random() * 1000);          
const updateRes = await client.execute(updateFn);

However, following the documentation here https://developer.intacct.com/api/accounts-receivable/customers/#update-customer
I'm able to successfully update the customer as expected using the raw XML request in postman. Confirmed by checking the comments field on the record after executing the call.

<function controlid="testFunctionId">
    <update>
        <CUSTOMER>
            <CUSTOMERID>TESTCUSTOMER</CUSTOMERID>
            <COMMENTS>test - 1234</COMMENTS>
        </CUSTOMER>
    </update>
</function>

ALSO why does the CustomerUpdate() function not support being able to reference customer by RECORDNO when either RECORDNO or CUSTOMERID is supported in the XML API?

Fix Typedoc links to the source code

It looks like it's linking to older blobs of the code and not the version it compiled against. We need to figure out where it is pulling/using this from.

ContactUpdate can't update by recordNo

How can I update a contact record by its recordNo?

Im looking at the code for the function and I do not see it accepting recordNo as a parameter

It shows in the docs that its possible but it is also a bit contradictory. RecordNo is both optional and required

RECORDNO | Optional | integer | Record number of contact to update. Required if not using CONTACTNAME.

CONTACTNAME | Optional | string | Contact name. Required if not using RECORDNO.

RECORDNO | Required | integer | Record number of contact

class ContactUpdate extends AbstractContact_1.default {
    writeXml(xml) {
        xml.writeStartElement("function");
        xml.writeAttribute("controlid", this.controlId, true);
        xml.writeStartElement("update");
        xml.writeStartElement("CONTACT");
        xml.writeElement("CONTACTNAME", this.contactName, true);
        xml.writeElement("PRINTAS", this.printAs);
        xml.writeElement("COMPANYNAME", this.companyName);
        xml.writeElement("TAXABLE", this.taxable);
        xml.writeElement("TAXID", this.taxId);
        xml.writeElement("TAXGROUP", this.contactTaxGroupName);
        xml.writeElement("PREFIX", this.prefix);
        xml.writeElement("FIRSTNAME", this.firstName);
        xml.writeElement("LASTNAME", this.lastName);
        xml.writeElement("INITIAL", this.middleName);
        xml.writeElement("PHONE1", this.primaryPhoneNo);
        xml.writeElement("PHONE2", this.secondaryPhoneNo);
        xml.writeElement("CELLPHONE", this.cellularPhoneNo);
        xml.writeElement("PAGER", this.pagerNo);
        xml.writeElement("FAX", this.faxNo);
        xml.writeElement("EMAIL1", this.primaryEmailAddress);
        xml.writeElement("EMAIL2", this.secondaryEmailAddress);
        xml.writeElement("URL1", this.primaryUrl);
        xml.writeElement("URL2", this.secondaryUrl);
        if (this.active === true) {
            xml.writeElement("STATUS", "active");
        }
        else if (this.active === false) {
            xml.writeElement("STATUS", "inactive");
        }
        this.writeXmlMailAddress(xml);
        xml.writeEndElement(); // CONTACT
        xml.writeEndElement(); // update
        xml.writeEndElement(); // function
    }
}
exports.default = ContactUpdate;

GH Pages branch is outdated

Additionally, the documentation included in the pages isn't all that helpful due to lack of actual documentation / comments. It would be great to see the pages updated to at least be up to date with the current SDK version.

Error in the response for pagination

Hi everyone!
I'm using the latest version (2.1.0) and I getting an error when I paginate results.
More specifically in this line https://github.com/Intacct/intacct-sdk-node-js-examples/blob/master/list-vendors.js#L46 you are checking if .resultId is not null, but in my response appears this:

 {
 results: [
    Result {
      status: 'success',
      _functionName: 'query',
      _controlId: '2BLAHd-eBLAHa-41a2-822c-9BLAHc',
      _listType: 'GLACCOUNT',
      _totalCount: 93,
      _count: 20,
      _numRemaining: 73,
      _data: [Array]
    }
  ]
  }

Is the .resultId replaced by controlId for some reason?

ContactUpdate does not work properly

When using ContactUpdate, it will randomly tell me that the contact does not exist

'Cannot update non-existing CONTACT with CONTACTNAME=ExampleContactName'

I know this contact exists because I check if it exists using IA.Functions.Common.ReadByQuery() before I attempt to update it.

Code Example

const query = new IA.Functions.Company.ContactUpdate();
      
      query.contactName = contact.CONTACTNAME;
      query.printAs = contact.PRINTAS;
      query.companyName = contact.COMPANYNAME;
      query.taxable = contact.TAXABLE;
      query.taxId = contact.TAXID;
      query.contactTaxGroupName = contact.TAXGROUP;
      query.prefix = contact.PREFIX;
      query.firstName = contact.FIRSTNAME;
      query.lastName = contact.LASTNAME;
      query.middleName = contact.INITIAL;
      query.primaryPhoneNo = contact.PHONE1;
      query.secondaryPhoneNo = contact.PHONE2;
      query.cellularPhoneNo = contact.CELLPHONE;
      query.pagerNo = contact.PAGER;
      query.faxNo = contact.FAX;
      query.primaryEmailAddress = contact.EMAIL1;
      query.secondaryEmailAddress = contact.EMAIL2;
      query.primaryUrl = contact.URL1;
      query.secondaryUrl = contact.URL2;
      query.active = (contact.STATUS === 'active') || false;

      query.addressLine1 = contact['MAILADDRESS.ADDRESS1'];
      query.addressLine2 = contact['MAILADDRESS.ADDRESS2'];
      query.city = contact['MAILADDRESS.CITY'];
      query.stateProvince = contact['MAILADDRESS.STATE'];
      query.zipPostalCode = contact['MAILADDRESS.ZIP'];
      query.country = contact['MAILADDRESS.COUNTRY'];
      query.isoCountryCode = contact['MAILADDRESS.COUNTRYCODE'];

      try {
        const response = await this.client.execute(query);
        resolve(response.getResult());
      } catch (err) {
        reject(err);
      }

Fix SDK Reference link in README

It's pointing to https://intacct.github.io/intacct-sdk-js/annotated.html, which does not exist. Change it to https://intacct.github.io/intacct-sdk-js/.

How can I update an APPayment?

Hi,
I looked on the js-sdk and I didn't find any way to update an APPayment.
How can I update an APPayment?
Thanks
Bogdan

BL03002128: Error while creating bill record

Hello,

My team has encountered an error while attempting to create a new bill using the Javascript SDK.

For a little bit of background, we built a microservice to allow various databases to interact with the Intacct system.
The following JSON object gets mapped to the appropriate fields in the SDK's BillCreate object:

[ { "VENDORID": "20200", "WHENCREATED": "2022-02-21", "WHENDUE": "2022-03-10", "APBILLITEMS": [ { "ACCOUNTNO": "60410", "TRX_AMOUNT": "9.45", "LOCATIONID": "100", "DEPARTMENTID": "100" } ] } ]

However, we're pretty consistently getting the following response:

{ "response": { "errors": [ "BL03002128 Enter a Bill number, and try again. [Support ID: BHF%401EB034%7EYhVWlP0o213-8KQW5T4tIQAAAB4]", "BL01001973 Currently, we can't create the transaction Check the transaction for errors or inconsistencies, then try again." ] }, "status": 400, "message": "Result status: failure for Control ID: 5de1e778-6882-477c-aa3e-0e19a706bba5 - BL03002128 Enter a Bill number, and try again. [Support ID: BHF%401EB034%7EYhVWlP0o213-8KQW5T4tIQAAAB4] - BL01001973 Currently, we can't create the transaction Check the transaction for errors or inconsistencies, then try again." }

I'm having a little bit of trouble interpreting this error message because I'm not aware of a way to include a bill number in our create call based on the SDK docs (and wouldn't the bill number be generated on creation anyway?).

Anything you can do to help me get to the bottom of this error would be greatly appreciated by my team and me!

OnlineResponse.ts line 51 - TypeError: Cannot read property 'hasOwnProperty' of undefined

The following code

const config = new ClientConfig();
config.senderId = "testsenderid";
config.senderPassword = "pass123!";
config.companyId = "testconsoleid|testclientid";
config.userId = "invaliduserid";
config.userPassword = "testpass";

const sessionCreds = await SessionProvider.factory(config);

Throws the following

TypeError: Cannot read property 'hasOwnProperty' of undefined
    at new ErrorMessage (src\Xml\Response\ErrorMessage.ts:34:27)
    at new OnlineResponse (src\Xml\OnlineResponse.ts:51:34)
    at C:\Users\user\WebstormProjects\intacct-sdk-js\src\Xml\RequestHandler.ts:66:20
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

In OnlineResponse.ts, this is the section throwing

if (this._authentication.status !== "success") {
    const errorMessage = new ErrorMessage(this._xml["response"]["operation"]["errormessage"]);

    throw new ResponseException("Response authentication status failure", errorMessage.errors);
}

To replicate this, the company ID must be in pipe form testconsoleid|testclientid and the user ID in the console must be invalid. For whatever reason with this combo, Web Services returns the following XML response which is completely missing any sort of errormessage element in the operation block.

<?xml version="1.0" encoding="UTF-8"?>
<response>
    <control>
        <status>success</status>
        <senderid>testsenderid</senderid>
        <controlid>sessionProvider</controlid>
        <uniqueid>false</uniqueid>
        <dtdversion>3.0</dtdversion>
    </control>
    <operation>
        <authentication>
            <status>failure</status>
            <userid>invaliduserid</userid>
            <companyid>testconsoleid</companyid>
            <locationid></locationid>
        </authentication>
    </operation>
</response>

Add ArPaymentCreate but not the legacy version

I need to create an AR Payment using the new create function on the ARPYMT object. You implemented the legacy version that creates an ARPAYMENT object instead. I need to know:

  • Is it on your road map implement this version of this function?
  • Is there any way to do what I need?
  • Must I adjust to the legacy version?

Thanks in advance!

IntacctException - Response result block is missing status element

This is happening when uniqueid = true and a duplicate statistical journal entry is trying to be created. I understand it should throw an error in this case but it seems there is a bug in the actual Result class.

IntacctException [Error]: Response result block is missing status element
    at new Result (/usr/src/app/node_modules/@intacct/intacct-sdk/dist/Xml/Response/Result.js:66:19)
    at new OnlineResponse (/usr/src/app/node_modules/@intacct/intacct-sdk/dist/Xml/OnlineResponse.js:55:44)
    at RequestHandler.<anonymous> (/usr/src/app/node_modules/@intacct/intacct-sdk/dist/Xml/RequestHandler.js:58:20)
    at Generator.next (<anonymous>)
    at fulfilled (/usr/src/app/node_modules/@intacct/intacct-sdk/dist/Xml/RequestHandler.js:7:58)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

Getting timeout error while filtering & sorting SODOCUMENTENTRY by WHENMODIFIED field

I am trying to fetch all changed/modified records from last month API is giving me a timeout error.
It used to work before we are running this query for last year, but for the last 2 or 3 weeks, it is getting timed out.

Reference Code

const filter = new IA.Functions.Common.NewQuery.QueryFilter.AndOperator()
filter.addFilter(new IA.Functions.Common.NewQuery.QueryFilter.Filter('WHENMODIFIED').greaterThan(new Date('2021-01-01') as any))
filter.addFilter(new IA.Functions.Common.NewQuery.QueryFilter.Filter('SODOCUMENT.DOCPARID').in(['Sales Order', 'Sales Invoice', 'Sales Return', 'Sales Quote', 'Web Order']))
const selectBuilder = new IA.Functions.Common.NewQuery.QuerySelect.SelectBuilder()
selectBuilder.addFields(_.map(this.columns, 'name'))
const selects = selectBuilder.selects

const orderBuilder = new IA.Functions.Common.NewQuery.QueryOrderBy.OrderBuilder()
orderBuilder.addAscending('WHENMODIFIED')
const orders = orderBuilder.orders

const query = new IA.Functions.Common.NewQuery.Query()
query.selectFields = selects
query.fromObject = 'SODOCUMENTENTRY'
query.filter = filter
query.caseInsensitive = true
query.pageSize = 100
query.orderBy = orders
query.offset = this.offset

const custResponse = await intacct.client.execute(query)
const custResult = custResponse.getResult()

I tried removing order by and restricting the date to last 1 week, but still getting the timeout error, this only happens with SODOCUMENTENTRY, we are using the same for few other entities they are working fine

When will this be available?

I am just starting an integration using node. I only need invoicing at this time and was wondering if you had anything to commit so I can use and/or help build on. Need to know ASAP. Thanks!

AR Invoice fulfillmentStatus set incorrectly

If you try to create an invoice with a fulfillmentStatus like:

const command = new OrderEntryTransactionLineCreate();
command.fulfillmentStatus = 'Undelivered'

Then you get back: XL03000003 XML Parse schema error: Error 1843: Element 'fulfillmentstatus': Character content other than whitespace is not allowed because the content type is 'element-only'. That happens because fulfillmentstatus is being treated as a string rather than an element with subelements. See also: https://developer.intacct.com/api/order-entry/order-entry-transactions/#create-order-entry-transaction-legacy.

nodejs query question

Greetings, spent couple of days trying to sort the following out

nodejs 12.22.3
OS: Windows 10

the following code works when removing the filter.

        const query = new IA.Functions.Common.ReadByQuery();
        let where = new IA.Functions.Common.Query.Comparison.Like.LikeString();

        where.field = "asset_tag";
        where.value = "Power";
        query.query = where;

        getAssets(client, query);

But with the filter on, it returns 0 results, where am I fumbling the rock?

Thanks!

Reading custom fields not working

API v1.3.0

Hi, i added custom fields to a bill object, just like in your tests:

        record.customFields = [
            [ "customfield1", "customvalue1" ],
        ];

When i try to query the recently created bill object,

            queryFields: [
                "RECORDNO",
                "VENDORID",
                "WHENCREATED",
                "WHENDUE",
                "CURRENCY",
                "APBILLITEMS",
                "DESCRIPTION",
                "RECORDID",
                "DOCNUMBER",
               "CUSTOMFIELD1",
               "CUSTOMFIELDS"
            ], 

Every other property is returned correctly, but both "CUSTOMFIELD1" and "CUSTOMFIELDS" is empty, i didn't find a way to retrieve the data i inserted.

Is there any example or tests i can look into on how to retrieve them ?

Go SDK + CloudQuery Source Plugin?

Hi Team, hopefully this is right place to ask, if not, I'd appreciate if you can direct me.

I'm the founder of cloudquery.io, a high performance open source ELT framework.

Our users are interested in an Sage Intacct plugin, but as we cannot maintain all the plugins ourselves, I was curious if this would be an interesting collaboration, where we would help implement an initial source plugin, and you will help maintain it.

This will give your users the ability to sync Sage Intacct data to any of their datalakes/data-warehouses/databases easily using any of the growing list of CQ destination plugins.

Best,
Yevgeny

When will online payments be available in ArPaymentCreate?

Im using the SDK to allow our customers to pay invoices and noticed the TODO to add online payment which is documented in the API (ONLINECARDPAYMENT). I am writing a custom function to handle this for now, but I just wondered when this will be available within the SDK?

Result.ensureStatusNotFailure logic is incorrect

When you run executeBatch with the transaction attribute set to true,

//...
let requestConfig = new IA.RequestConfig();
requestConfig.transaction = true;
await intacctClient.executeBatch(apiFunctions, requestConfig);

I believe the initial thought with the following code calling ensureStatusNotFailure was that the offending function in the operation would be status=failure and any other proceeding functions status=aborted.

https://github.com/Intacct/intacct-sdk-js/blob/bdadac479a3ac6c8b2a34e5429b1ddf3afa740f1/src/Xml/Response/Result.ts#L186-L193

Unfortunately this isn't the case when the request's operation.transaction=true. All functions are returned with status=aborted and the offending function has a result.errors.length > 0. It looks like this is a similar problem on the other SDK's as well.

fixed-sample.js

let requestConfig = new IA.RequestConfig();
requestConfig.transaction = true;
const bufferResponse = await intacctClient.executeBatch(apiFunctions, requestConfig);
for (const result of bufferResponse.results) {
    if (result.status !== 'success' && result.errors.length > 0) {
        throw new ResultException(
            "Result status: " + result.status + " for Control ID: " + result.controlId,
            result.errors
        );
    }
}

Sample XML request for Postman

<?xml version="1.0" encoding="UTF-8"?>
<request>
  <control>
    <senderid>{{sender_id}}</senderid>
    <password>{{sender_password}}</password>
    <controlid>{{$timestamp}}</controlid>
    <uniqueid>false</uniqueid>
    <dtdversion>3.0</dtdversion>
    <includewhitespace>false</includewhitespace>
  </control>
  <operation transaction="true">
    <authentication>
      <sessionid>{{temp_session_id}}</sessionid>
    </authentication>
    <content>
      <function controlid="{{$guid}}">
        <create>
          <APBILL>
            <WHENCREATED>2021-07-27</WHENCREATED>
            <VENDORID>20000</VENDORID>
            <RECORDID>1234</RECORDID>
            <DOCNUMBER>Ref 5678</DOCNUMBER>
            <TERMNAME></TERMNAME>
            <WHENDUE>2021-08-27</WHENDUE>
            <CURRENCY>USD</CURRENCY>
            <BASECURR>USD</BASECURR>
            <EXCH_RATE_TYPE_ID>Intacct Daily Rate</EXCH_RATE_TYPE_ID>
            <ACTION>Draft</ACTION>
            <SUPDOCID>PMD-10251</SUPDOCID>
            <APBILLITEMS>
              <APBILLITEM>
                <ACCOUNTNO>6220</ACCOUNTNO>
                <TRX_AMOUNT>100.12</TRX_AMOUNT>
                <ENTRYDESCRIPTION>Line 1 of my bill</ENTRYDESCRIPTION>
                <VENDORID>20000</VENDORID>
              </APBILLITEM>
            </APBILLITEMS>
          </APBILL>
        </create>
      </function>
      
      <function controlid="{{$guid}}">
        <create_supdoc>
          <supdocid>PMD-10251</supdocid>
          <supdocname>Hello World</supdocname>
          <supdocfoldername></supdocfoldername>
          <supdocdescription>Description</supdocdescription>
          <attachments>
            <attachment>
              <attachmentname>My Attachment1</attachmentname>
              <attachmenttype>txt</attachmenttype>
              <attachmentdata>aGVsbG8gd29ybGQhIHRoaXMgaXMgYmFzZTY0IGVuY29kZWQgZGF0YQ==</attachmentdata>
            </attachment>
          </attachments>
        </create_supdoc>
      </function>

    </content>
  </operation>
</request>

Sample XML response

<?xml version="1.0" encoding="UTF-8"?>
<response>
    <control>
        <status>success</status>
        <senderid>xxxxxx</senderid>
        <controlid>1627412560</controlid>
        <uniqueid>false</uniqueid>
        <dtdversion>3.0</dtdversion>
    </control>
    <operation>
        <authentication>
            <status>success</status>
            <userid>xxx</userid>
            <companyid>xxxx</companyid>
            <locationid></locationid>
            <sessiontimestamp>2021-07-27T19:02:41+00:00</sessiontimestamp>
            <sessiontimeout>2021-07-28T01:02:41+00:00</sessiontimeout>
        </authentication>
        <result>
            <status>aborted</status>
            <function>create</function>
            <controlid>ec786abe-c541-4d42-92db-6cb2065baa68</controlid>
            <data listtype="objects" count="1">
                <apbill>
                    <RECORDNO>196</RECORDNO>
                </apbill>
            </data>
        </result>
        <result>
            <status>aborted</status>
            <function>create_supdoc</function>
            <controlid>490acf5e-0190-4277-a097-24ef64b5a26b</controlid>
            <errormessage>
                <error>
                    <errorno>BL03000113</errorno>
                    <description></description>
                    <description2>Folder name is not valid [Support ID: JDT2R%7EYQBYUWEsBPF3vEw6j8gTHQAAABo]</description2>
                    <correction></correction>
                </error>
                <error>
                    <errorno>XL03000009</errorno>
                    <description></description>
                    <description2>The entire transaction in this operation has been rolled back due to an error.</description2>
                    <correction></correction>
                </error>
            </errormessage>
        </result>
    </operation>
</response>

Adding Missing fields

Is it possible to add missing fields that are in the native api but not the nodejs SDK? For example offsetGLAccount for Vendors is available in the API but not on the SDK.

Query is not working properly

Hi.
I am trying to pull REVRECSCHEDULEENTRY records using ReadByQuery.
When I the query parameter blank, it works well with all results. (total: 8863)
But If I set the query to "POSTED = 'Posted'", it doesn't pull any data. (total: 0)
Thanks.

Long lists in QueryFilter 'value' cause an error

Hello,

I am trying to create a query that pulls the RECORDID for every invoice whose RECORDNO value appears in a list that I include in a QueryFilter statement.

let invoice_query = new IA.Functions.Common.NewQuery.Query()
invoice_query.fromObject = 'ARINVOICE'

let querySelect = new IA.Functions.Common.NewQuery.QuerySelect.SelectBuilder()
querySelect.addFields(['RECORDNO', 'RECORDID'])
invoice_query.selectFields = querySelect.selects

invoice_query.pageSize = 2000

let queryFilter = new IA.Functions.Common.NewQuery.QueryFilter.Filter('RECORDNO').in(invoice_nos)
invoice_query.assignFilter(queryFilter)

The code that I included above works when the length of invoice_nos is less than a certain threshold (I haven't been able to confirm this, but the threshold appears to be 1000); however, once the list length exceeds that threshold, attempts to execute the query yield the following error:

"XL03000003 XML Parse schema error: Error 1871: Element 'value': This element is not expected.. Line: 1, column: 0. [Support ID: MhL0rEB033%7EX-Xq6P0w2ZI-R2%40WZhcqhQAAAAU]"

Am I diagnosing this error correctly in concluding that I'm exceeding a limit on the length of the list? If so, are there any workarounds that I should be aware of, and/or can I expect this behavior to change in the future?

Thanks in advance.

Some fields in APBILL and APBILLITEM cannot be queried

Hello,

I'm seeing an error when querying some fields in these two objects using IA.Functions.Common.NewQuery.Query.

ResultException [Error]: Result status: failure for Control ID: 65d824c7-68c1-4a9c-9cea-cc4007c76ac6 - XL03000006 The following fields cannot be queried: [ apbill: [PAYTOCONTACTNAME, RETURNTOCONTACTNAME] ] [Support ID: LYF3ZEB034%7EYeogyP0F2YJ-hwZWD-iCgQAAABU]

These are the fields that I've run into issues with:

APBILL

  • PAYTOCONTACTNAME
  • RETURNTOCONTACTNAME

APBILLITEM

  • GLACCOUNTNO

I'm using the version 2.1.1 of the @intacct/intacct-sdk

ApiSessionCreate issue

Hi,

Apologies if I'm doing something wrong and it's not a real issue, but I'm currently running into problems using the ApiSessionCreate function.

Example:

const query = new IA.Functions.ApiSessionCreate();

This gives me the error that:

IA.Functions.ApiSessionCreate is not a constructor

By following the example code on this repo, other calls seem to be made in a similar way:

const query = new IA.Functions.AccountsReceivable.CustomerCreate();

This works correctly.

Am I doing something wrong, or is the ApiSessionCreate not exported correctly?

Thanks,

Bigi

.intacct directory exception

I should not get an exception when the directory/ini does not exist.

(node:15768) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: ENOENT: no such file or directory, open 'C:\Users\username\.intacct\credentials.ini'

const config = new IA.ClientConfig();
const query = new IA.Functions.Common.ReadByQuery();
query.objectName = "CUSTOMER";
query.pageSize = 100;

const client = new IA.OnlineClient(config);
const response = await client.execute(query);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.