At one of my current customers we had a rather interesting business requirement that I thought I’d share the solution for.

We have an automated system that imports faxes into CRM from a centralized fax gateway product.  We naturally create a Fax Entity record and attach the fax file ( which is a PDF in this case ) to the record.

So far, this is normal business processing.  Here comes the interesting part.

Due to a secondary business requirement, we don’t want users entering Notes on Faxes.  This presents a problem because Attachments are shown as Notes.  Since some issues can’t easily be controlled training, I started looking for a way of restricting the user from creating notes.

Note: I should also mention that all of our Faxes are Incoming, not Outgoing, and we only create inbound faxes programmatically.

Modifying the user’s security role would have worked, mostly, it may have caused problems in the future.  So I decided to invest in a little JavaScript.  This goes in the form OnLoad event of the Fax Entity:

//
// Hide the add note link to prevent users from adding a note manually
//
crmForm.all.tab2Tab.onclick = function() 
{ 
   document.all["notescontrol"].contentWindow.document.all.newNoteButton.style.display = 'none'; 
}
 

Ok, this is mostly unsupported, but not in a major way.   What we are doing is appending a new Click event on the Notes tab ( which is tab #2, if counting from 0 ).

When a user clicks on the Notes tab, this small bit of JavaScript is executed and the Create new note hyperlink is hidden.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>