Help!
I am using values() to highlight required fields on the screen as long as they are null (ie have no data in them) and it appears to be working for all field types except "dateonly" and I cannot figure out why...
I have a requirement for a screen that I need to highlight a field on the screen until it is populated. The purpose is to let users know this field is required to be populated before the workflow button to move to the next stage in the workflow will appear. This is a "transition" stage in the workflow. At this stage, users will be returning to this screen to complete somewhat of a "checklist". Once the checklist is complete, the workflow button for the next stage will appear. There are A LOT of fields on this screen, which is why there is a requirement to highlight the fields necessary to trip the appearance of the workflow button. In order to help the user visually, once the required field is populated, the field should no longer be highlighted.
I have this working for most of the fields, but I am getting tripped up by the different field types. One other thing that I didn't mention is that the highlighting on the field is only to appear during the "transition" stage.
In order to meet this requirement, I have used crm.ready() in the custom content of the screen. I created a function called RequiredYellow(). The function seems to work for all field types except a dateonly field and I have not been able to figure out why. Here is a snippet of what I have tried...the selection type and the checkbox type work fine (so showing what is working for me). The last if statement is the one I am have issues with. I have shown what I have tried on the dateonly type and none of those seem to work. How do I determine that the dateonly field has not been populated?
function RequiredYellow(){
if (crm("oppo_stage").value()== "transition") {
if (crm("oppo_selectiontype").value() == null) {
crm.fields("oppo_selectiontype").highlight();
} }
{
if (crm("oppo_checkboxtype").value() == "") {
crm.fields("oppo_checkboxtype").highlight();
} }
{
if (crm("oppo_dateonlytype").value() == "") || (crm("oppo_dateonlytype").value() == null) || (crm("oppo_dateonlytype").value() == 'undefined') {
crm.fields("oppo_localprojectapprovaldate").highlight();
} }
}
Any assistance would be greatly appreciated!