This topic contains 12 replies, has 0 voices, and was last updated by al3xicon 8 years ago.

  • Author
    Posts
  • #1587

    darrenhillconsulting

    Anyone ever create a ‘deposit’ record in Netsuite before? I’m not able to use dynamic mode, which I think is messing up a bunch of other fields.

    Any tips and tricks for those experienced with doing one? I’m in a trial and error LOOP!
    This is a cached copy. Click here to see the original post.

  • #1588

    darrenhillconsulting

    Maybe its an SS2 thing .. I did the exact same thing in SS1 and it worked.

    I get this error in SS2

    “type”:”error.SuiteScriptError”,”name”:”UNEXPECTED _ERROR”,”message”:”ReferenceError: “document” is not defined. (NLRecordScripting.scriptInit$lib#309)”,”stack”:[“anonymous(N/recordService)”,”(/SuiteScripts/DH/Integration/Deposit/DH_Deposit.js:53)”],”cause”:{“type”:”internal error”,”code”:”UNEXPECTED_ERROR”,”details”:”Refere nceError: “document” is not defined. (NLRecordScripting.scriptInit$lib#309)”,”userEvent “:”aftersubmit”,”stackTrace”:[“anonymous(N/recordService)”,”(/SuiteScripts/DH/Integration/Deposit/DH_Deposit.js:53)”],”notifyOff”:false},”id”:””,”notifyOff”:false}

    For the record, line 53 of my script is the ‘save’

  • #1589

    david.smith

    I’m assuming you mean the “customerdeposit”? What seems to be the issue?

  • #1590

    darrenhillconsulting

    All I did was set the class/department and set ‘deposit’ to true on the first line of the ‘payment’ sublist. Should work fine as a PoC. Is this a Netsuite bug in SS2?

  • #1591

    darrenhillconsulting

    Originally posted by david.smith

    View Post

    I’m assuming you mean the “customerdeposit”? What seems to be the issue?

    Actually no, I mean ‘deposit’. I’ve built an integration that is receiving bank deposit information, and I’m building a Netsuite deposit based on its information. It’ll be pretty sweet. But man .. this bug! Please say I don’t have to revert back to old school SS1

  • #1592

    david.smith

    So you mentioned you couldn’t do dynamic mode? Can you post a code snip?

  • #1593

    chanarbon

    Hi Darren,

    Does this only happen to new records or does this concern happen as well on loading the record and saving it and performing record.submitFields()?

  • #1594

    darrenhillconsulting

    I’m going to spend an hour building out simply use cases using ss2 and ss1 and will post the results here. Chanarbon. I’ll include trying to ‘edit’ an existing deposit as well as using record.submitFields().

  • #1595

    darrenhillconsulting

    So, here we go. Very simple test case.

    SS1.0 code works fine …

    Code:
    var deposit = nlapiCreateRecord(‘deposit’);
    deposit.setLineItemValue(‘payment’, ‘deposit’, 1, ‘T’);
    nlapiSubmitRecord(deposit);
    SS2.0 throws an error

    Code:
    var deposit = record.create({type: ‘deposit’});
    deposit.setSublistValue({sublistId: ‘payment’, fieldId: ‘deposit’, line: 0, value: true});
    deposit.save();
    โ€‹
    The error being …

    {“type”:”error.SuiteScriptError”,”name”:”UNEXPECTE D_ERROR”,”message”:”ReferenceError: “document” is not defined. (NLRecordScripting.scriptInit$lib#402)”,”stack”:[“anonymous(N/recordService)”,”(/SuiteScripts/DH TESTS/depositTest.js:15)”],”cause”:{“type”:”internal error”,”code”:”UNEXPECTED_ERROR”,”details”:”Refere nceError: “document” is not defined. (NLRecordScripting.scriptInit$lib#402)”,”userEvent “:null,”stackTrace”:[“anonymous(N/recordService)”,”(/SuiteScripts/DH TESTS/depositTest.js:15)”],”notifyOff”:false},”id”:””,”notifyOff”:false}

    I’m praying I’m simply doing something wrong … otherwise, what gives?

  • #1596

    erictgrubaugh

    My immediate reaction is that this has to be a 2.0 bug; somewhere in the 2.0 code, a reference to `document` is leaking. Probably some code that they are expecting to run client-side that is being executed server-side, where there is no `document`. I can’t see anything that you should be doing differently on your end.

  • #1597

    darrenhillconsulting

    I’m in agreement with you Eric, thanks for chiming in.

  • #1598

    darrenhillconsulting

    So, Netsuite has acknowledged this is a bug .. server-side. The work around is either Client scripts or SS1.0. See Defect # 418131.

    Arg. SS1.0 it is!

  • #1599

    al3xicon

    Sigh…of course it is.

You must be logged in to reply to this topic.