Hi,
According to the CustomerCompanyUpdate function in System/CustomerCompany.pm, if the actual CustomerID and the new CustomerID are specified as CustomerID and CustomerCompanyID, the function should update the customerID without having to create a new company and then move all customer users to from the old to the new company.
I've tried to change the code from the Admin Customer Company interface, and it fires a 500 Internal Server Error (log show "no such company XXXXXX"). So I created a custom script that calls the CustomerCompanyUpdate function with both IDs, and it still gives an error "no such company XXXX"
This is how I call the function inside my script:
$CustomerObject->CustomerCompanyUpdate(
CustomerCompanyID => $CustomerCompanyList{CustomerID},
CustomerID => $Company->{CustomerCode},
CustomerCompanyName => $Company->{CustomerName},
PaymentsID => $CustomerCompanyList{PaymentsID},
CustomerTypeID => $CustomerCompanyList{CustomerTypeID},
CustomerCompanySystemID => $CustomerCompanyList{CustomerCompanySystemID},
CustomerCompanyCodeID => $CustomerCompanyList{CustomerCompanyCodeID},
CustomerCompanyStreet => $CustomerCompanyList{CustomerCompanyStreet},
CustomerCompanyZIP => $CustomerCompanyList{CustomerCompanyZIP},
CustomerCompanyCity => $CustomerCompanyList{CustomerCompanyCity},
CustomerCompanyCountry => $CustomerCompanyList{CustomerCompanyCountry},
CustomerCompanyURL => $CustomerCompanyList{CustomerCompanyURL},
CustomerCompanyComment => $CustomerCompanyList{CustomerCompanyComment},
CustomerCompanyParentCustID => $Company->{DealerCode},
CustomerCompanyParentCompName => $Company->{DealerName},
ValidID => 1,
UserID => 1,
);
obviously, variables on the right side have been correctly populated with the right values, I checked them with Dumper
I know that there is a setting in SysConfig to work with this feature, but I couldn't figure out how to configure it correctly.
I'll be very grateful for any hint on this one.
--
Lynx International Srl Stefano Finetti
Lynx International Srl is a part of AXED Group
Via Pier Luigi Nervi e/3 - Torre 6 - 04100 Latina