This must have been asked before, but I can’t find it.
I’ve have a form displayed in list view where each record displays just a few fields on one line. The underlying table has a “notes” field, which is not shown in the list view because of the space it would take up. Some records have a completed note field and some do not.
How do I create a visual indicator which shows the user which record, in list view, has information in the notes field, so they know to check it out.
How do I get a field to display a different colour using a calculation. For example the following calculation simply puts the font colour values in the field instead of changing the colour.
if (eventnote)
{
return ‘#dae1e4’;
}
Looking at the Demo CRM systems each record is highlighted when it is clicked and each record does not have the black indicator on the left hand side. I can’t work out how this was acheived. I can’t see any calculations that did this… can anybody shed some light on this?
When in record view you could use an onShowscript that sets the bgcolor of an element (make sure to enter the NAME property of a field, otherwise it won’t show up in the elements node in the editor):
elements.myField.bgcolor = "#FFFFFF"
However when in list/tableview this would result in the entire column changing color, because “physically” there’s only one element used for the entire column.
To avoid this you can use the html renderer which gets triggered when ever you put a textstring starting with tag inside a label/button
a) create an unstored calc “myCalc”:
if (eventnote)
{
'<html><table border=0><tr><td bgcolor="#dae1e4" height="50" width="500"> </td></tr></table>';
}
//note that width and height are set to "fill up" the field entirely
b)place a label in your form and set the dataprovider property to “myCalc”;
c) in listview you can put the label behind other fields. In tableview however, all elements/objects are set next each other.
MerMer:
Many thanks. Two further related questions.
How do I get a field to display a different colour using a calculation. For example the following calculation simply puts the font colour values in the field instead of changing the colour.
If you don’t want to use html in a calculation to set the color, use a label to return the calculated value (turn on the “displaysTags” property) instead of a field. Then set the font and color of the label directly.
Many thanks for the suggestions. I ended up changing the list view to a table view so I didn’t want to use a label. I used a button and added the following code which adds a small dot in the middle of the button.