How to Fetch the county code in Phone Data Type based on the Company's Country

How to Fetch the county code in Phone Data Type based on the Company’s Country

1 Like

You can set it to default; otherwise, you have to apply client script to set the scenario, but I’m not sure!

[EDIT]

Please check the client script syntax:

frappe.ui.form.on('Test DocType', {
    onload: function(frm) {
        var country = your_logic; // Add your logic
        if (country == "India") {
            frm.set_value('mobile_no', '+91-');
        } else if (country == "United States") {
            frm.set_value('mobile_no', '+1-');
        }
    }
});

Now you can set the logic according to the scenario.