It appears that I do need to ask one question in regards to this. This does work to hide the Communications Options. Yeah!
However, it hides it on ALL the new email buttons throughout the system. Boo!
Since I put a custom parameter in my button, I thought I could use that parameter to hide the box if my parameter condition was met. However, it is not working. Therefore, I am wondering if I did not understand what I might be able to do with that custom parameter or if I simply have an error in my code that I need to look more closely for.
This is how I added my button...
var strCHSEmailLeaseButton = CRM.Button("CHS Email Lease","NewEmail.gif",CRM.URL("1500") + "&Lease=Y");
I added it to my block with this....
I added your above example to the custom content box of my screen (modified). As I indicated, it works...but it does it for ALL the email screens.
Therefore, I tried wrapping the example code as follows...but it is not working. (Note: I did use the custom param previously in the custom content for another purpose...but thought I could use it again for this. Maybe not?)
Can you tell me if this should work in custom content? Thank you!!
function HideEmailFilingBox ()
var myparam = crm.getArg("Lease", crm.url());
if(myparam === "Y")
the code above modified accordingly (the above code works before I add the custom param)
Any assistance is greatly appreciated!!