formatting sysdate in java
bigcrayJul 12 2010 — edited Jul 19 2010I'm trying grey out fields if a effective date is passed the sysdate. I don't want the users to be able to modify any field on the record except for the terminiation date.
I'm using a java script in the page HTML Header that i found.
</script>
<script type="text/javascript">
function disFormItems(){
var lReturn = $v('P2_EFFECTIVEDATE')
var lsysdate = $v('sysdate')
var lTest = (lReturn < lsysdate)?true:false;
$x_disableItem('P2_RESOURCE_NAME',lTest)
$x_disableItem('P2_EFFECTIVEDATE',lTest)
$x_disableItem('P2_EMS_EQUIPMENT_NAME',lTest);
}
</script>
so far i can make this grey out all the records or not grey out any of the records. I believe its because my date fields are in two different formats. So i guess i have two questions really how can i tell what format apex is using for P2_EFFECTIVEDATE and SYSDATE and how can i get them into the same format. Is there a better way of doing what I'm trying to do? Thanks.