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

SS1: Support arbitrary sublist names. #16

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

paulclarkaranz
Copy link
Contributor

@paulclarkaranz paulclarkaranz commented Nov 26, 2018

Adds support for using record sublists other than item and addressbook. This shouldn't require any changes in dependant pieces of
code unless they were relying on matching an error message or on selectNewLineItem erroring on unsupported records (it also "upserts" in the SS2 module).

Most places that would have previously complained about unsupported lines will now complain about TypeError: Cannot * property '*' of undefined. Exceptions are:

  • selectNewLineItem: will create new sublist groups and new currentLine groups as appropriate in line with what selectNewLine does in the SS2 module. (I'm not sure what that addressbookaddress thing is for but left it in for compatibility.)
  • getLineItemCount it was already returning 0 for unknown sublists so I left it that way

I have left lineItems and addressBookLines as aliases in case they are being used in existing tests somehow (I don't think that is possible given the scope though). lineItems is still used in transform(), I am not sure if that should be updated and if so what to.

Edit: also fixed bug in the SS1 search API.

@paulclarkaranz paulclarkaranz force-pushed the feat/SS1_support_arbitrary_sublists branch from 2be1cf6 to 338db3f Compare November 26, 2018 01:07
Adds support for using record sublists other than `item` and
`addressbook`. This shouldn't require any changes in dependant pieces of
code unless they were relying on matching an error message or on
`selectNewLineItem` erroring on unsupported records (it also "upserts"
in the SS2 module).

Most places that would have previously complained about unsupported lines will
now complain about `TypeError: Cannot * property '*' of undefined`. Exceptions
are:
* `selectNewLineItem`: Will create new sublist groups and new currentLine
  groups as appropriate in line with what `selectNewLine` does in the SS2
  module. (I'm not sure what that `addressbookaddress` thing is for but left
  it in for compatibility.)
* `getLineItemCount` it was already returning 0 for unknown sublists so I left
  it that way

I have left `lineItems` and `addressBookLines` as aliases in case they are
being used in existing tests somehow (I don't think that is possible given the
scope though). `lineItems` is still used in `transform()`, I am not sure if
that should be updated and if so what to.
Similar to in 3EN-Cloud#12, add `setCurrentLineItemText` to set
line item list fields by display string.

And the same caveat applies, getting the value later won't return the
index like it would in NetSuite.
@paulclarkaranz paulclarkaranz force-pushed the feat/SS1_support_arbitrary_sublists branch from 96edce6 to b9d2e26 Compare November 26, 2018 01:49
In NetSuite this returns the display string for select fields. Here it
returns the value, like everything else.
Previously the search `nlobjSearchFilter.matchesRecord()` was always
returning undefined so `nlapiSearchRecord` should never have been
matching anything.
@paulclarkaranz paulclarkaranz force-pushed the feat/SS1_support_arbitrary_sublists branch from f376e92 to d44cfd4 Compare November 26, 2018 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant