CRM4 notification message when field is value is set to certain value

122 views Asked by At

I have a CRM4 application and as part of our customer database we have created a no contact list whereby a notification will be displayed to users to inform them that the customer is not to be contacted if this field is set but I am having some troubles in closing the window after they press OK. My code is as follows:

if(crmForm.all.new_nocontactallowed.DataValue == 1)
{
    alert(‘This user is on a do not contact list by Legal & Compliance under no circumstances should this customer be contacted.’);
}

The new_nocontactallowed field is of type bit and is displayed on the form and set to true then an alert is fired. How can I close the form after the user has clicked on the notification in the alert box.

Also is there any way of editing the title of the alert box so that it does not show as message from webpage?

1

There are 1 answers

0
pen2 On

Execution of jscript is blocked when alert is displayed so puting closing code right after alert will be enough. You can use crmForm.SaveAndClose() to save and close form or window.close() to just close. Also there is no way to change the title.