Vendor Extension Table | CSF NORWAY

I am trying to create a vendor from Custom Code.

var svc = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.VendorSvcContract>(Db);

var VTcreate = new Erp.Tablesets.VendorTableset();
svc.GetNewVendor(ref VTcreate);
var vcreate = VTcreate.Vendor.FirstOrDefault();
vcreate.VendorID = “31071”;
vcreate.Name = “Vendor Name”;
vcreate.ZIP = “12345”;
vcreate.City = “Oslo”;
vcreate.Address1 = “Address Line”;
vcreate.CurrencyCode = “NOK”;
vcreate.TaxPayerID = “TaxID”;
vcreate.TermsCode = “N045”;
vcreate.Inactive = false;
vcreate.Approved = false;
vcreate.CountryNum = 163;
vcreate.LegalName = “Legal Vendor”;
vcreate.RowMod = “A”;
svc.Update(ref VTcreate);

When I try to create it manually there are no errors. But When I try with the code it gives me Error


.

This code works for other companies in Which CSF is not installed.
I Suspect it has something to do with the Extension tables for Vendor.
Any Clue will be helful.

Thanks

Is this something related to incorrect CSF Installation ?

my gut says that the vendors now need an additional field’s data because of the CSF. The ‘null reference’ error message shouts that something is missing from your data. I’d look at the Supplier Master tab for the CSF data and see what field gets a default value when you create a new Supplier manually in the UI. (I’m assuming there is something now in the Supplier Master UI).

1 Like