Example of a Custom Handler for a Form Object

The following is a pseudocode example of a custom handler for a Form object. The example includes an RGB value (rgb(255,255,0)) for the field value background color of yellow, and a hexadecimal value (#ff0000) for the field value text color of red.

function myColorHandler()
{
	var accountValue = oraclecrmod.getField("AccountValue").getValue();
	var field = oraclecrmod.getField("AccountName");

	if (accountvalue>1000000) then
	{

		field.setColor({"labelBgColor":"Red","labelTextColor":"Yellow",
		"valueBgColor":"rgb(255,255,0)","valueTextColor":"#ff0000"});

	}
	else { 
		field.setColor({"labelBgColor":"","labelTextColor":"",
		"valueBgColor":"","valueTextColor":""});

	}
}
//set up the color handler
oraclecrmod.getForm().on("display",myColorHandler)

For a full code sample, see Code Sample for Color Coding of Fields and Rows.