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
benderguybenderguy 

How do I stop SFDC from populating Mailing address when creating a new Contact for an Account?

My goal is to create a new contact from an existing account and have the address of the account populate the "Other" address fields in Salesforce, instead of the "Mailing" address fields as it does by default.  (You'll run into the same problem I describe here also if you want no address populated as well.)  I've spoken to a few people, and even had an SFDC engineer provide some suggestions, but still have a problem.  He suggested I post my question here.

To make this happen, I've created a new button on the Contacts list section of the Account page (right next to the default "New Contact" button there) (there are other ways to do this as well, like via s-controls, but this is the simplest for testing the solution.):

Display Type: List Button
Behavior: Display in existing window without sidebar or header
content source: URL
code:
https://na6.salesforce.com/003/e?retURL=/{!Account.Id }&
con18street={!Account.BillingStreet}&
con18city={!Account.BillingCity}&
con18state={!Account.BillingState}&
con18zip={!Account.BillingPostalCode}&
con18country={!Account.BillingCountry}&
con10={!Account.Phone}&
con11={!Account.Fax}&
con4={!Account.Name}

(The con18 fields are the Other address fields on the Contact edit page.)
When you use this button, however, it still automatically populates the Mailing address fields with the Account address.  In fact, even if I add to the URL to explicitly blank out the Mailing address fields, like this:

https://na6.salesforce.com/003/e?retURL=/{!Account.Id }&
con18street={!Account.BillingStreet}&con19street=&
con18city={!Account.BillingCity}&con19city=&
con18state={!Account.BillingState}&con19state=&
con18zip={!Account.BillingPostalCode}&con19zip=&
con18country={!Account.BillingCountry}&con19country=&
con10={!Account.Phone}&
con11={!Account.Fax}&
con4={!Account.Name}

(the con19 fields are thhe Mailing address fields on the Contact edit page)
it still populates the Mailing address fields.  However, if I change the above URL to include something like

...&con19country=x&...

(and not change any of the other code from the above example), it does not populate the Mailing address fields (other than that now Mailing Country = x.)

SO...

There must be some script on the page that looks up the provided account name, finds its address info, and puts it into the Mailing address fields on the account unless any Mailing address is provided.  Note that I am not even passing the "id=" parameter, either.

It is pretty annoying that SFDC just assumes that you need to have the mailing address populated on the Account Contact with a specific address from the Account, without providing any opportunity to change that functionality.  Sure, I could rename all the fields, or build some kind of record save workflow to blank out the fields, but those aren't really very good solutions.

Does anyone know how to override this Mailing address population activity or have a better solution? 

werewolfwerewolf
Actually, your second URL should work; it works for me.  Perhaps something in the street is screwing up the URL?  Try escaping (i.e. URL encoding) the strings you're trying to put in those fields.
werewolfwerewolf
Also, I noticed you're not supplying the accid parameter to set the account ID.  That's going to hurt later...
_Prasu__Prasu_

Making a standard field value blank by this ways does not works. If you try same thing with the custom fields it works.

Kenneth_EA_JensenKenneth_EA_Jensen

I'm in the situation that I want to fill out the mailing address with the information from shipping address instead of billing address.

 

Seeing that this seemed like a good way to do that, since benderguy indicates that he is succesful with overwriting the default behavior with something else as long as he doesn't try to blank the mailing address I tried to implement it for test.

 

However I find that even if I do something like '&con19country=x' in my code it will still be overwriten by the billing address if con4={!Account.Name} is also included.

 

A modification of benderguys code into this:


/003/e?retURL=/{!Account.Id }&
={!Account.Id}&
con4={!Account.Name}&
con19street={!Account.ShippingStreet}&
con19city={!Account.ShippingCity}&
con19state={!Account.ShippingState}&
con19zip={!Account.ShippingPostalCode}&
con19country={!Account.ShippingCountry}&
con10={!Account.Phone}

 

Should work  as I understand whats written here, and if the con4={!Account.Name}& is removed it does, but as soon as it is included billing address is written in the fields. Is there something I'm missing, since according to the statements here, it should be possible to overwrite the mailing fields, just not leave them blank?