on 2024 Oct 02 5:27 PM
Hello experts. I'm trying to update individual customer information through the sdk. Here's the current set of code that I'm using:
var updateCustomer = Customer.Retrieve(existingCustomer.InternalID);
var existingAddressInfo = updateCustomer.AddressInformation.GetFirst();
var existingAddress = existingAddressInfo.Address;
var existingEmail = existingAddress.DefaultEMail;
var updateCustomerCustomerCommon = updateCustomer.CurrentCommon;
var updateCustomerAddressInfo = updateCustomer.AddressInformation.Create();
var updateCustomerAddress = updateCustomerAddressInfo.Address;
// update address
var defaultemailbo = updateCustomerAddress.DefaultEMail;
if (!defaultemailbo.IsSet()) {
defaultemailbo = updateCustomerAddress.DefaultEMail.Create();
}
var email = updateCustomer.AddressInformation.Address.DefaultEMail.GetFirst();
defaultemailbo.URI.content = this.Email.content;
// update phone
var defaultphonebo = updateCustomerAddress.DefaultConventionalPhone;
if (!defaultphonebo.IsSet()) {
defaultphonebo = updateCustomerAddress.DefaultConventionalPhone.Create();
}
defaultphonebo.FormattedNumberDescription = "+" + this.Home_Phone;
// Update address
var address = updateCustomerAddress.DefaultPostalAddressRepresentation;
if (!address.IsSet()) {
address = updateCustomerAddress.DefaultPostalAddressRepresentation.Create();
}
address.CountryCode = updateCustomerCustomerCommon.Person.NationalityCountryCode;
address.RegionCode.content = region;
address.CityName = this.City;
address.StreetName = this.Addr;
if (this.Postal_Code.IsInitial()) {
address.StreetPostalCode = "00000";
} else {
address.StreetPostalCode = this.Postal_Code;
}
address.AdditionalHouseID = this.Addr2;
}
The individual customer is updating but the text on the individual customers account isn't reflecting the change:
How do I update the text in the details tab through the SDK? Thanks in advance.
Request clarification before answering.
Hi,
I don't know if it's still relevant, but it used to be that sometimes trying to write information using those shortcut variables didn't work so you had to specify the full path. What I suggest is:
updateCustomer.AddressInformation.Address.DefaultEMail.URI.content = <new email>;
That might work for you.
Lewis
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
21 | |
16 | |
3 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.