We cannot change the primary subsidiary of the vendor once the transactions are posted.
But we can assign a number of secondary subsidiaries at any time after the vendor is created
We can manually assign the same by editing vendor records.But for bulk changing it is not possible to edit and save each record.For that we can do a Mass update od schedule script to update the same.
The following code snippet allows you to perform the subsidiary change using a suite script.
ar record = require(["N/record"]);
var record = require("N/record");
var vsr = record.create({
type: record.Type.VENDOR_SUBSIDIARY_RELATIONSHIP
});
vsr.setValue({
fieldId: 'entity',
value: 2
});
vsr.setValue({
fieldId: 'subsidiary',
value: 6
});
var recId = vsr.save();