On a button, I run a script which looks like following:
Code: Select all
if(fields.END_DATE.value == null){
resources.REHAB_WKST_NOT_DATEMAX.fetch();
log("SYSTEM " + system.variables.$FETCH_COUNT.value);
log("MAX DATE: "+ fields.MAX_DATE.value);
fields.END_DATE.value = fields.MAX_DATE.value;
}
below is the output from Execution Log:
Database query runs fine in oracle and gives a valid output and is read only type. REF_DATE is the field name mapped to MAX_DATE. Below is the query.15:55:28.003 Debug: Debug for database resource REHAB_WKST_NOT_DATEMAX - SQL statement:
15:55:28.003 Debug: SELECT MAX (REFERRAL_DATE) REF_DATE FROM REFERRALS
15:55:28.003 Debug: End execution of command - fetch : 15:55:28.003
15:55:28.003 Info : SYSTEM 1
15:55:28.003 Info : MAX DATE: null
Code: Select all
SELECT MAX (REFERRAL_DATE) REF_DATE FROM REFERRALS