How to upload and associate a contact record to th...
# ask-stanley-ai
a
How to upload and associate a contact record to the partner contact sublist? straight csv upload not linking to partner sublist
c
AI generated answer (using internal Slack threads):
To upload and associate a contact record to the partner contact sublist, you would need to follow a two-step process as NetSuite does not allow direct linking of contacts to partners via CSV upload. 1. Create the Contact Record: You can create a contact record using SuiteScript's
record.create
method. Here is a sample code snippet:
Copy code
javascript
var contactRecord = record.create({
    type: record.Type.CONTACT,
    isDynamic: true
});
contactRecord.setValue({
    fieldId: 'firstname',
    value: 'John'
});
contactRecord.setValue({
    fieldId: 'lastname',
    value: 'Doe'
});
var contactId = contactRecord.save();
2. Link the Contact to the Partner Record: After creating the contact record, you can then link it to the partner record using the
setValue
method. Here is a sample code snippet:
Copy code
javascript
var partnerRecord = record.load({
    type: record.Type.PARTNER,
    id: 'partnerId',
    isDynamic: true
});
partnerRecord.selectNewLine({
    sublistId: 'contactroles'
});
partnerRecord.setCurrentSublistValue({
    sublistId: 'contactroles',
    fieldId: 'contact',
    value: contactId
});
partnerRecord.commitLine({
    sublistId: 'contactroles'
});
partnerRecord.save();
Please replace
'partnerId'
with the actual ID of the partner record you want to link the contact to. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.828992724
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.828012586
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.827218
Please provide your feedback on this answer.
Thank you for your feedback