Alert on Case Update

Jason116
Tera Contributor

I need to display an alert (pop up message with 'OK' to acknowledge) on a case when ever it is updated but only if it is from a certain contact, I have tried the foillowing client script but does not work, any assistance please?

 

function onChange(control, oldValue, newValue, isLoading) {
    // Check if the case is from the contact "TEST"
    var contact = g_form.getValue('customer_contact');
    if (customer_contact == 'TEST') {
        // Display pop-up message
        alert('Case has been updated.');
    }
}
1 ACCEPTED SOLUTION

Hi @Jason116 

Thanks for your response

May be something is happening with you because the same script i have tested on my instance it's working.

Tips: Please check you account value and backend name of your field

//onSubmit client script
var test="test";
var account=g_form.getValue('account');// take the account value so that can be mapped with specifiec account value in this case we used "test"
if(account==test&&!g_form.isNewRecord())
{
g_form.setValue('account',account);
alert('ok');
}

 

View solution in original post

10 REPLIES 10

I have tried both onChange and onSubmit versions of this in my PDI and does not work, can you verify it works for you?

Seraj
Tera Guru

Hi @Jason116 ,

Try this

function onChange(control, oldValue, newValue, isLoading) {
    // Check if the case is from the contact "TEST"
    var contact = g_form.getValue('customer_contact');
    if (!g_form.isNewRecord()&&customer_contact == 'TEST') {
        // Display pop-up message
        alert('Case has been updated.');
    }
}

 

Jason116
Tera Contributor

Sorry this is not doing anything?

 

Also can we change this so that it happens on account not contact?

i.e. I need the alert to be displayed when any update is made to the case and the account = TEST

Hi @Jason116 

I am unable to grab what exactly you are expecting or trying to do.

Can you explain more about your requirement if it is possible send one picture of your form

 

Thanks

 

Jason116
Tera Contributor

The requirement is the following:

 

On the case form I need to display an alert (pop up message with 'OK' to acknowledge) when ever it is updated but only if the account on the case = TEST