function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nicklas WallmanNicklas Wallman 

Issue creating accounts with billing address information

Hello, 

I'm using the SOAP API using .NET.

I've stumbled upon a problem while trying to create an account with billing address information. The following exception message is available "Element {urn.enterprise.soap.sforce.com}city invalid at this location." If I remove the city field, it just switches the city field to another in the billing address structure, such as the PostalCode.

It seems like this is happening when performing an update (so I've done a SELECT QUERY before that). It looks like this: 

"SELECT AccountNumber, CurrencyIsoCode, BillingAddress FROM Account WHERE AccountNumber = {id}"

If I just remove the BillingAddress part from the query and as well as the BillingAddress structure from the account object, it seems to work. Although, of course I won't get the BillingAddress updated.

Thanks in advance!
Matt SmelserMatt Smelser
Nicklas-
To work with the BillingAddress you need to break it up into parts. BillingCity, BillingStreet, BillingState, etc...
Here a link to the SOAP Api documentation for the Account Object. https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_account.htm
Nicklas WallmanNicklas Wallman
Hi Matt,

Thanks for the reply. I forgot to add - that's exactly what I did before and got it working that way, however for some reason the billing address information wouldn't show up under the account. However, I'll just re-check and get back if it persists.

Thanks for your time!