Window Alert for Address

SOLVED

I have a situation where we want a window alert to display when creating a new company/address when the country is Saudi Arabia. The alert would be something to the affect of "Please confirmation additional taxes needed on quotes/orders". This popup could appear when saving the record or when selecting the country code. 

I am assuming this can be done VIA custom content and/or oncreate for the address screen, but I am not a very strong javascripter. This is 2018 R2.

Any insight is greatly appreciated. 

Thanks,
Anthony

  • +1
    verified answer

    Hi Anthony

    I am going to make the assumption that within the address record the field addr_country is a selection list and is required.  Saudi Arabia has the value of 'SA'.

    The fields are contained in a screen block called AddressBoxLong.  

    In the custom content you can add some Javascript (make sure to add this in Script tags)

    function checkAddress(x)
    {
    if (x == 'SA')
    {
    crm.infoMessage("hello world");
    return x;
    }
    else
    {
    return x;
    }
    }

    In the onChange script of the field addr_country then add

    this.value = checkAddress(this.value)

    To understand more about this see:

    www.youtube.com/watch

  • 0 in reply to Sage CRM

    Perfect! Thank you.