[Vtigercrm-developers] Make address-country a picklist?

Manuel Fernando ptdesigner at gmail.com
Tue Sep 20 09:52:30 GMT 2016


Very good Alan,

The only thing that doesn’t work, is when you select contact or company in invoices, quotes etc and doesn’t populate the field country.

If you want country field in inventory to be populated, add this to Edit.js inside Inventory/resources in mapAddressDetails

container.find('select[name="'+key+'"] option').removeAttr('selected').filter('[value="'+result[addressDetails[key]]+'"]').attr('selected', true);
container.find('select[name="'+key+'"]').trigger('liszt:updated');



Best Regards.

Manuel



> No dia 19/09/2016, às 10:18, Alan Lord <alanslists at gmail.com> escreveu:
> 
> On 19/09/16 09:44, socialboostdk wrote:
>> Hi there,
>> 
>> I have a client who wants the country-field to be a picklist instead of
>> freetext. This actually makes very good sense to me, as "Disneyland"
>> will never be a valid country, and spelling of real contries should
>> never differ in order to search by country, etc.
>> 
>> Are there any issues with just de-activating current country field and
>> add picklist?
>> 
>> I'm thinking "yes" beacuse the functions to copy address data etc - but
>> any ida on what to do?
> 
> We've done this for a few customers... It is a royal PITA because of the various different tables, columnnames and ways addresses are stored. What that means is you will need to create several completely separate Picklists to store the Country values.
> 
> Here's a script that might help you to do what you want though ;-)
> 
> http://paste.ubuntu.com/23202014/
> 
> Cheers
> 
> Al
> 
> PS: The copy address function works fine IIRC.
> 
> _______________________________________________
> http://www.vtiger.com/




More information about the vtigercrm-developers mailing list