Wednesday, September 24, 2008

Check Number of notes attached to a Crm Record.


Write below code on save of the entity.

var CRM_FORM_TYPE_CREATE = 1;
 
if (crmForm.FormType == CRM_FORM_TYPE_CREATE)
{
    var obj=document.frames(”notescontrol”).document;
    var textarea=obj.getElementsByTagName(’TEXTAREA’);
 
    if (textarea.length < 1)
    {
        alert (”please eneter somenotes”);
 
        // Cancel the save
        event.returnValue = false;
    }
}

No comments: