Does anyone have insight as to why I am unable to ...
# general
n
Does anyone have insight as to why I am unable to select an existing ship/bill address on a transaction via suitescript (in a restlet)? I am setting
shipaddresslist
/`billaddresslist` to an existing customeraddress id for that entity and nothing else, then save. As a result,
null
is the value stored there, and a new custom address subrecord is created that is empty, with only the country populated. (new
shippingaddress_key
/`billingaddress_key` id). The transaction and customer records are not scripted (no user or client scripts, no workflows, default form - including address form). I don't have address validation. I do have SuiteTax and TaxJar, for what it's worth, but I don't think it's relevant. Thanks.
b
basic debugging step would be to create/load the record in dynamic mode and use Field.getSelectOptions to see the valid options for the field
more specific in this case is a warning that addresses have an internal id and an address internal id that are different values
n
Done. Looks like the id that I am passing is in the options. The number that I am passing is the
value
of an option.
b
try disabling all the other user event scripts on your transaction
n
Already done.
It does sound like something is interfering, but I'm at a loss for what. I've got no active/deployed scripts for the customer or transactions.
b
id double check the scripted records for anything
other than that ive got nothing
you can try sharing you code in case someone else can see anything
n
I've looked over the "Scripted Record" page, as an overview. But I've also looked through my files in general.
Copy code
/**
 * @NApiVersion 2.x
 * @NScriptType Restlet
 */
define([
    'N/record',
    'exports'
], function (
    record,
    exports
) {
    exports.put = function () {
        var netsuite_record = record.load({type: 'estimate', id: 9226});
        netsuite_record.setValue({fieldId: 'billaddresslist', value: 11731});
        netsuite_record.save();
    };
});
@battk, thanks for trying.
l
Hey @Nathan Did you try to load the record in dynamic Mode?
n
Yes, I just tried in above code. I added
isDynamic: true
to load options. No luck.
I have un-deployed every user event and client script on the server. Still have issue. If I create a user event and view the
newRecord
during
beforeLoad
event, it still has previous good data. When I view the data during
beforeSubmit
event, it has the updated bad data. Still, this seems to point to a script affecting it, but none are deployed. :(
b
workflows
n
All workflows are inactive.
b
canceled workflow states?
n
huh?
I only have a couple workflows, neither of which apply to transaction record types. I made them inactive, and created a new transaction to test, ensuring it is not in the workflows.
What's interesting, is in my other test Netsuite instance, this isn't an issue. I've got the same config on both. The one with the issue is on 2020.2. Other is 2020.1
b
n
I don't see any notes about address changes in the release, nor would I expect that big of an issue made it through.
b
probably not an issue if workflows arent applied to your transactions
n
No fix from mass cancel
I neglected to mention, this issue doesn't happen when editing in the UI. Only when done in restlet, with the originally provided code.
b
same role?
n
no, different role for restlet
b
probably at least change to testing in the ui with the same role used by the restlet
or the reverse of changing the role of the restlet to that used in the ui
n
Used restlet role (custom) in UI, sucess. Used UI role (Administrator) with restlet call (using N/https in console), failed. No fix.