This topic contains 5 replies, has 0 voices, and was last updated by srussell 6 years, 7 months ago.

  • Author
    Posts
  • #23957

    bsullivan

    How can I set the External ID field to NULL? The CSV import doesn't let me do this. Even when I import in blank fields into the External ID field it doesn't work.
    This is a cached copy. Click here to see the original post.

  • #23958

    greg.hill

    Hi bsullivan,

    Not sure if you have figured out the solution for this but if not, there is an option to set a default value for any NetSuite fields in Step #4 – Field Mapping of the CSV file import process – including setting fields to NULL. When in the Field Mapping step of the CSV import process, select the 'Externalid' field from the NetSuite Fields on the right side. It will add this field to the middle section of the UI where you would then typically select the fields from your CSV file to map. However, don't select a field from the 'Your Fields' section – instead, click on the little pencil icon to the left of the section showing the mapping and on the row just added for 'Externalid'. You will then be presented with an option to either "Provide Default Value" or "Set Value to Null". Obviously, you would select the "Set Value to Null" option. Continue to map your other fields and run your import and you should null out the external ID values as required.

    Thanks,

    Greg

  • #23959

    mmeyer

    You can't seem to import a null value to this field, see screenshot… Netsuite, any workarounds for us? I need to be able to clear the external ID on a couple thousand inactive items…

  • #23960

    mwhite@hgyp.com

    This is actually a pain. The only way I know to do it is with a script. I'd use a custom workflow action.

  • #23961

    pcutler

    With SuiteScript you can load a record, set the external ID, and submit it. Depending on your use case, you could do this in a user event script, mass update script, scheduled script, etc.

    The code would be:

    Code:
    var recordId = '123';
    var recordType = 'customrecord1';
    var record = nlapiLoadRecord(recordType, recordId);
    record.setFieldValue('externalid', '');
    nlapiSubmitRecord(record);

  • #23962

    srussell

    pcutler I'm trying to set or update externalid using SuiteScript 2.0. I'm creating a unique string from fields in the record and setting that to newExternalId. The first line below works fine, it sets the desired string into a notes field, but the second line that should set it into the externalid does not.

    record.setValue('custrecord_notes', newExternalId);

    record.setValue('externalid', newExternalId);

    Do you know what the problem is here?

    Edit: Figured it out. I needed to load the record with the N/record module and save it that way instead of saving it on the context object.

You must be logged in to reply to this topic.