Enforcing Leaf Node Selection in Select Subject Dialogue Box
Recently one of my colleague was facing an issue with Subject Lookup dialogue box. The requirement was to enable selection of only leaf-nodes i.e. any node with a child node should not be selected as a Subject. After little R&D I came up with the following
Edit : \CRMWeb\_controls\lookup\lookupsubject.aspx
In function applyChange
just below the following statement
if currentSubject != ""
{
put this script…
try{
if(document.getElementById(currentSubject.Id).parentNode.parentNode.attributes['isExpanded'])
{
alert('saaary.. saary meri vajah se hai..');
return;
}
}
catch(e)
{
alert('Error in sadu logic of leaf node selection.' + e.message);
}
I was in strange mood so I've put some garbage text in messages, basically first message box notifies end user when S/He tries to select a non-leaf node and the second message box says there was some error with the script.