This topic contains 1 reply, has 0 voices, and was last updated by Olivier Gagnon NC 7 years, 5 months ago.

  • Author
    Posts
  • #21603

    khultquist

    This is just an FYI to others who use scripts.

    I have two scripts that started having issues after 2017.1 upgrade. In both cases, certain fields are set on a new record object and submitted successfully, but the record in NS shows the fields as null or default value. In both cases, I am able to work around by resubmitting the fields a second time. I am not willing to submit a case to NetSuite because I know it's a time drain and they will make me prove that it's their issue, plus there's a workaround so it's unlikely to get fixed. But I at least feel obligated to tell other users to watch for this kind of problem. Again, these scripts were working successfully in 2016 and previous releases, and only now show this behavior.

    Example 1, using nlapiSubmitField()

    Code:

    var child_record = nlapiCopyRecord('salesorder', parent_id);
    child_record.setFieldValue('customform', child_form);

    var id = nlapiSubmitRecord(child_record, true);
    nlapiSubmitField('salesorder', id, 'customform', child_form, false); // custom form not working on original submit, try updating 22-May-2017

    Example 2, have to reload the record and cycle through all items to update

    Code:

    while (qty_remaining > 0) {

    receive_record.setLineItemValue('item', 'binnumbers', earliest_line, bin);

    }

    var submit_receive = nlapiSubmitRecord(receive_record, true); // USAGE = 20

    // binnumbers not working on original record submit, have to reload the record and update the field on each line — added 20-May-2017
    var record_resubmit = nlapiLoadRecord('itemreceipt',submit_receive);
    var lines_resubmit = record_resubmit.getLineItemCount('item');
    for (var x = 1; lines_resubmit && x<=lines_resubmit; x++){
    record_resubmit.setLineItemValue('item', 'binnumbers', x, bin);
    }
    var try_again = nlapiSubmitRecord(record_resubmit, true);
    This is a cached copy. Click here to see the original post.

  • #21604

    Olivier Gagnon NC

    Thanks, appreciate it. I share your frustration in regards to getting cases filed to get things fixed when it comes to scripting. At least we can share and make each other aware.

You must be logged in to reply to this topic.