This topic contains 2 replies, has 0 voices, and was last updated by Colby_sylvane 5 years, 11 months ago.

  • Author
    Posts
  • #21264 Score: 0

    Colby_sylvane
    • Contributions: 0
    • Level 1

    Have been tracking down a nasty bug for quite a while with no luck. Heres what I know.

    We are creating sales order records via suitescript and setting shipaddress (msr – shipaddress on line item) with an internal id of an addressbook record like this:

    record.setCurrentLineItemValue('item', 'shipaddress', [addrbookaddrid] );

    record.commitLineItem('item');

    This almost always seems to work fine. However we find that when we have user event scripts (or client scripts) that read the value of the ship address

    on these lines after the record has been saved, and there is no value. This ship to address mysteriously disappears. This happens seemingly randomly. We cannot reproduce the error, only catch it after the fact.

    THE CATCH(es):

    We are not able to easily programatically identify when this occurs. We become aware because a script that expects a shipto (shipaddress) value on a line item will notify us via error handling.

    I am not able to create a search that will identify missing ship to addresses because the search results shows that there IS a value:

    var search = nlapiCreateSearch('transaction',

    [

    new nlobjSearchFilter('type', null, 'is', 'SalesOrd'),

    new nlobjSearchFilter('internalid', null, 'is', '34730534[ID OF KNOWN DISSAPPEARING SHIP TO ORDER]'),

    new nlobjSearchFilter('mainline', null, 'is', 'F'),

    ],

    [

    new nlobjSearchColumn('shipaddress', null, 'MAX'),

    ]);

    console.log(search.runSearch().getResults(0, 1)[0].getValue('shipaddress', null, 'MAX'));

    Outputs:

    Clyde Customer 1807 BURCH AVE SIMI VALLEY CA 93063-3219 United States

    Even More: I notice that if I load the sales order in UI, I can visible see that there is not a shipaddress value.

    I save the sales order (no changes)

    History shows that the shipaddress was unset from Clyde Customer 1807 BURCH AVE SIMI VALLEY CA 93063-3219 United States to Null

    I added a debug script to aftersubmit event on sales order to try to 'catch' this dissappearing act.

    In this context, I never catch anything. It appears as though the server side after submit script is seeing a value for shipaddress even though it doesnt appear that way in the ui or if i run a form script to check

    I have to find out what is happening to these addresses and have been spinning in circles with support. This is the best ive been able to isolate the issue and show that something isnt right.

    You guys got any ideas on what I can check or what would cause this behavior.

    Thanks!
    This is a cached copy. Click here to see the original post.

  • #21265 Score: 0

    BobSmallwood
    • Contributions: 0
    • Level 1

    If you are going to include line level addresses, you probably need to set the 'Enable Item Line Shipping' flag on the transaction (set 'ismultishipto' to true) before adding addresses on the salesorder lines.

    FYI, I have also found that when Line-level shipping is enabled, the transaction-level shipping address is blanked out. We have even had some (built-in) script failures for that exact reason.

    Hope this helps!

  • #21266 Score: 0

    Colby_sylvane
    • Contributions: 0
    • Level 1

    Thanks, I went ahead and set that flag to T just in case that might be causing some effect. I believe that fields value is true by default already. Still seeing that quite a bit of orders are not displaying the ship to address and we cannot read it via scripting although it appears in searches. Netsuite support did not offer any valuable feedback from their investigation.

You must be logged in to reply to this topic.