littleb
littleb

Reputation: 55

Net Suite Override internal id

Is this possible to set or override the internalid of a custom record type ? The internalid is self generated, but I want to try to set inernalid value from a cvs field.

Upvotes: 1

Views: 3714

Answers (4)

ankit
ankit

Reputation: 2845

You can set ExternalId and if you want to get record then you can use callGetRecordByExternalId .

public ReadResponse callGetRecordByExternalId(String externalId, RecordType recordType) throws RemoteException {
    return this.callGetRecord(Utils.createRecordRefWithExternalId(externalId, recordType));
}

Upvotes: 0

Suite Resources
Suite Resources

Reputation: 1164

OK. Given your feedback, why not create another custom field on the customer record that references the lookup value in the custom record?

The field type should be the same as the field type of the lookup value, with "store value" checkbox unchecked. On the Sourcing and Filtering tab, you specify the custom record type and field to reference. Think of it as a SQL join of sorts between the customer record and custom record.

Then, you should be able to do what you want with 2 getCurrentAttribute tags:

<%= getcurrentattribute('cusomter', 'custentity_mappingid')%>
<%= getcurrentattribute('cusomter', 'custentity_mappingvalue')%>

BTW, your custom field internal IDs look a little odd. They should start with 'custentity', and 'custrecord', respectively. My code above reflects what you'd normally expect from NetSuite.

Upvotes: 0

Suite Resources
Suite Resources

Reputation: 1164

You cannot override the internal ID of a record. As mentioned in a previous response to your question, you can (and should) set the external ID field on the NetSuite records to equal the primary key of the data being imported.

On future imports that update NetSuite data, you simply map the key field of the imported data to the external ID field in NetSuite. You can ignore the internal ID field on those future imports, as Netsuite will match up the records based upon the external ID.

This is the proper way to do this - I've seen tons of situations where people did not understand the external ID concept, and created huge, long term maintenance issues by not following this simple solution.

Upvotes: 1

erictgrubaugh
erictgrubaugh

Reputation: 8857

I do not believe you can override the internalid of any record instance, even a custom one. You can, however, use the externalid field that I believe every record has if you want to specify a "secondary" identifier for the record.

Upvotes: 3

Related Questions