On the select account button on the contact edit view, but I can’t find where this is being generated at. I would like to edit it to copy shipping address instead of billing.
I think this may be defined in modules/Contacts/metadata/editvewdefs for the account_name field. Try switching key to shipping and billingKey to shippingKey
But I still get the same, and yes I rebuilt and repaired. There is an EditView.tpl that is generated in the cache but I’m not sure whats called to generate it.
Here’s the relevant section from it.
Sorry for not being more verbose David. Do you have a file custom/modules/Contacts/metadata/editviewdefs.php? That would be the one you would need to make the changes to and doing so would make your changes upgrade safe.
Excellent, that did it for me. Thank you very much. I’m still curious how the editview.tpl is generated though, if you’ve got any info on that it’d be much appreciated.
Even more thanks if you can point me in the appropriate direction to populate the address field when using the create option on an account.
Editing the view.quickcreate.php to
require_once('include/MVC/View/views/view.quickcreate.php');
class ContactsViewQuickcreate extends ViewQuickcreate
{
public function preDisplay()
{
parent::preDisplay();
if($this->_isDCForm) {
//XXX TODO 20110329 Frank Steegmans: Hack to make quick create fields populate when used through the DC menu
// NOTE HOWEVER that sqs_objects form fields are not properly populated because of some other hacks
// resulting in none of the fields properly populating when selecting an account
if(!empty($this->bean->phone_office))$_REQUEST['phone_work'] = $this->bean->phone_office;
if(!empty($this->bean->shipping_address_street))$_REQUEST['primary_address_street'] = $this->bean->shipping_address_street;
if(!empty($this->bean->shipping_address_city))$_REQUEST['primary_address_city'] = $this->bean->shipping_address_city;
if(!empty($this->bean->shipping_address_state))$_REQUEST['primary_address_state'] = $this->bean->shipping_address_state;
if(!empty($this->bean->shipping_address_country))$_REQUEST['primary_address_country'] = $this->bean->shipping_address_country;
if(!empty($this->bean->shipping_address_postalcode))$_REQUEST['primary_address_postalcode'] = $this->bean->shipping_address_postalcode;
}
}
}
I’d suggest checking if there is a custom/modules/Contacts/views/view.quickcreate.php. There likely isn’t one but if there is make your changes there. If there isn’t create it and include and extend the ContactsViewQuickCreate with a CustomContactsViewQuickCreate class and make your edits there. Looks like the code you have should work.
Another option is to look at updating the controller.php for Contacts
I’m trying to implement this within our instance, but not having any joy with quick create. I was wondering if you had managed to implement this and if so where did you have to make the changes to do so?