Add Assignment for Actions in UI Development

Hi,

I have an action that calls a JDBC Adapter Service to insert a record. The record to be inserted will contain the created_date value.

In the add assignment for this action, I selected the service’s input parameter created_date and need to put in a date string. If I hardcode the value to “2012-01-01 12:00:00”, the service can be invoked without error. How do I replace the value with the current date?

I tried

#{Isaddawarddefaultviewview.insertAwardType.parameters.insertAwardType.insertAwardTypeInput.CREATE_DATE} = #{new java.util.Date.Date()} and

#{Isaddawarddefaultviewview.insertAwardType.parameters.insertAwardType.insertAwardTypeInput.CREATE_DATE} = #{new java.util.date.Date().toString()}

but both gave me the following errors

Encountered “java” at line 1, column 22. Was expecting one of: “}” … “.” … “[” … “>” … “gt” … “<” … “lt” … “>=” … “ge” … “<=” … “le” … “==” … “eq” … “!=” … “ne” … “&&” … “and” … “||” … “or” … “*” … “+” … “-” … “?” … “/” … “div” … “%” … “mod” …

Encountered “(” at line 1, column 22. Was expecting one of: “}” … “.” … “[” … “>” … “gt” … “<” … “lt” … “>=” … “ge” … “<=” … “le” … “==” … “eq” … “!=” … “ne” … “&&” … “and” … “||” … “or” … “*” … “+” … “-” … “?” … “/” … “div” … “%” … “mod” …

It does seem like the assignment does not like “new java.util.date.Date()”.

Can anyone give me some pointers?

You help is much appreciated!

If the created_date is always suppose to be “now” then don’t define a variable to pass it. Instead, assign ‘sysdate’ to the column in the adapter service. (sysdate is for Oracle, MS SQL Server has an equivalent but I don’t recall what it is at the moment; other DBs undoubtedly have something similar as well)

That will work. Many thanks.