Hi, I am trying to use the "Other relationships" f...
# suitescript
l
Hi, I am trying to use the "Other relationships" functionality of NetSuite (create a Customer also as Vendor), when the entity is created through CSV import. Based on the SuiteAnswer article 74233, I made the script but it doesn't seems to work. I saw when searching on the internet that it could be only available via client script. The solution given by SuiteAnswer was to call the url responsible for creating the relationship (something like):
"https://" + account + '/app/common/entity/company.nl?e=T&target=s_relation:otherrelationships&label=Other+Relationships&fromtype=custjob&id=' + context.newRecord.id + '&totype=vendor'
Did someone ever manage to create this relationship through script ?
b
relatively safe approach is to create a vendor and merge it to the customer using a EntityDeduplicationTask
going on the unsupported side is to use a transform
Copy code
record.transform({fromType: 'customer', fromId: '3864', toType: 'vendor'})
last way is to do basically what you tried before, but to add a Authorization header
l
I tried the REST API solution but I have an "unexpected error" from NetSuite ... I'll try your first solution. I don't like the Authorization header because I have to hardcode username and password.
b
i didn't give a REST api solution, but i would choose the first option too
l
By "REST API solution", I was referring to the RESTFull API. There is a path to /customer/{id}/!transform/vendor that I tried (with Postman)