Hi team, I want to develop a generic duplicate field procedure so users can copy the value from the row above with one keystroke, just like F3 in Oracle Forms. Currently they have to do copy-paste and that's a lot of work. The api_datasource.getColumnValueDT/TX/CL procedures need to know the datatype of the column in order to function correctly. How can i detect the datatype? By the way, api_datasource.setColumnValue does NOT need to know the data type. Probably formspider derives the type from the value-variable being set. Kind regards, Jan Willem Vermeer |
Hi Yalim, Indeed there is a shorter way... See below. With this the datatype additions #TX, #NR, #DT... are not needed anymore. So it's easier. For debugging purposes i had used several local variables - they have been removed now. Only problem left is that this function also works when the users calls it in a field that may not be updated... Is it possible to detect this? Kind regards, Jan Willem
|
Here an example how this can be done...
This works... However there are two problems. 1) We need to know the datatype for 2) We need to identify the row above in a more quick and easy manner. When doing previousRow all kinds of actions can be done, for example in my case a number of detail datasources is queried. And offcourse when going back (nextRow) this is done again. These actions make this script slow. Is there an easy way to get the rowid of the row above? I tried getPreviousCurrentRowId but that can be any row i navigated from. |
Hi, a generic duplicate field procedure may look like this. Only thing you have to do is to add elements NAME to the GRID and FIELDS. For the FIELDS you have to indicate the datatype by adding #TX, #NR, #DT, #CL or #BL. For example:
The procedure is:
Hi Jan Willem, I believe there might be a slightly easier way to do this. I am at Open World all week so I cannot test anything now but did you try to use the api_datasource.getRow API? That returns all the columns for a row in the datasource. Kind Regards,
(03 Oct '17, 13:12)
Yalim ♦♦
Also instead of looking at columns types, can't you just look at if any of the value fields have a not null value and if so simply populate the corresponding column in the new row with that value. Only one of the value fields will have a value.
(03 Oct '17, 13:14)
Yalim ♦♦
|