Can I create a phone field that starts with international calling codes?

good morning all

Many thanks for your help in advance!

I want to create a "phone" field in Sugar that automatically sets the country code based on the billing country field.

E.g. If UK is selected from the billing country dropdown, then the phone number field automatically starts with +44 etc. Is this possible to do from Studio?

Many thanks

Jaymie

Parents
  • Hi

    You can start building such a formula on Studio but the full implementation requires coding.

    Take a look at the formula for the field 'probability' at modules/Opportunities/vardefs.php

    getDropdownValue("sales_probability_dom",$sales_stage)

    You can setup a formula similar to this one for the target phone field. In order to do that you need to create a dropdown field whose keys are the keys from dropdown countries_dom and the values are the respective international calling codes.

    After that you need to edit the file custom/Extension/modules/Opportunities/Vardefs/sugarfield_{phone_field_c}.php in order to update the attribute 'enforced' from 'true' to 'false'.

    I hope this help

    André Lopes
    Lampada Global
    Skype: andre.lampada
Reply
  • Hi

    You can start building such a formula on Studio but the full implementation requires coding.

    Take a look at the formula for the field 'probability' at modules/Opportunities/vardefs.php

    getDropdownValue("sales_probability_dom",$sales_stage)

    You can setup a formula similar to this one for the target phone field. In order to do that you need to create a dropdown field whose keys are the keys from dropdown countries_dom and the values are the respective international calling codes.

    After that you need to edit the file custom/Extension/modules/Opportunities/Vardefs/sugarfield_{phone_field_c}.php in order to update the attribute 'enforced' from 'true' to 'false'.

    I hope this help

    André Lopes
    Lampada Global
    Skype: andre.lampada
Children
No Data