I found out how to hide fields with Javascript.
This solves my problem. The field is still actionable by javascript, but user cannot interact.
I copied
/modules/Opportunities/views/view.edit.php
to
/custom/modules/Opportunities/views/view.edit.php
The I added code to change the style elements of the probability field:
This solves my problem by hiding the field when the user mouses over.
The field reappears when the user selects a new Sales Stage.
I know...goofy, but it IS upgrade safe and does what I need.
It also doesn't interfere with the PROBABILITY_SCRIPT 's original purpose.
Code:
document.getElementsByName('probability')[0].style.display = "none"; Code:
$probability_script=<<<EOQ^M
<script>^M
prob_array = $prob_array;^M
document.getElementsByName('probability')[0].onmouseover = function() {
document.getElementsByName('probability')[0].style.display = "none";
};
document.getElementsByName('sales_stage')[0].onmouseover = function() {
document.getElementsByName('probability')[0].style.display = "block";
if(typeof(document.getElementsByName('sales_stage')[0].value) != "undefined" && prob_array[document.getElementsByName('sales_stage')[0].value]) {
document.getElementsByName('probability')[0].value = prob_array[document.getElementsByName('sales_stage')[0].value];
}
};
document.getElementsByName('sales_stage')[0].onchange = function() {
if(typeof(document.getElementsByName('sales_stage')[0].value) != "undefined" && prob_array[document.getElementsByName('sales_stage')[0].value]) {
document.getElementsByName('probability')[0].value = prob_array[document.getElementsByName('sales_stage')[0].value];
}
};
$prePopProb^M
</script>^M
Bookmarks