Thursday, December 5, 2013

Row status using expression language

Fast and easy to get row status using expression language:

#{row.row.entities[0].entityState == 0}

entities[0] where 0 is the entity index, if your view based on different entities you should consider this.

(0 = New, 2= Modified, 1 = Unmodified , -1 =  Initialized)

Wednesday, October 30, 2013

Oracle Database - Changing Day Order of the Week after Saudi Arabia Changed Weekend days

I wrote this post before two or three months, but I didn't have the chance to publish it:
here it goes.....

We had a function in which it updates a table that holds today's Umalqura current date, this function perform its calculations depending on Day order of the week and most of user machines we have either (forms6i or ADF "weblogic servers") have Saudi Arabia set as default locale.

The NLS_TERRITORY set to United Arab Emirates have Saturday with day number equals to 1. 
So to change the day order of the week which depends on NLS_TERRITORY DB parameter, rather than changing every client machine, you could do the following:

Create a Database trigger in which it firs after user login to database, and then overwrite the NLS_TERRITORY parameter to AMERICA in which Sunday corresponds to 1 as day number of the week.

Change the NLS_LANG in regedit to ARABIC_AMERICA ARMSWIN1256 for forms6i users.

This is was tricky fast solution rather than opening all forms to modify day of the week calculation that developers did ....!!!!!!