APEX - tabular form update
Hey guys,
as per client's request, we need to insert rows into db from tabular form even there is no change on the new row. db table is configured to have nullable fields.
Currently, it won't allow me to do so. Is there any way to force the insert/update without checking if the information on the row is updated?
Thanks a lot
You can do it, using manular tabular form.
When you use automated Tabular Forms, it checks inbuilt global variables, to see row is updated or any new row is created and all necessary fields are keyed in.
If you don't update an existing row, that row will not be updated..
If you create/add new empty row and don't key in values, that row will not be inserted as there is no data..
If you want to do in that manner, make your MRU process on the page to never and write your own manual MRU
Similar Messages
-
APEX tabular form update recognition
Dear all,
I am quite new to APEX so please apologize if I am asking "stupid" questions. Unfortunately, the information I was able to find up to now was only partially helpful. Apparently I must be missing something obvious. The APEX version I use is 4.0.1.
When submitting a page that contains a tabular form, I need to find out, which record has been created or updated in order to fill in additional information automatically, e.g. logging data (created, last updated, ...). I cannot do this in a trigger, because the trigger sees only APEX_PUBLIC_USER and does not know about the "real" user who has connected to the database. If there is a better or easier way to do this, please let me know.
My problem is to find out, if a new record has been added by clicking the "add row" button and / or if an existing record has been modified, because creation and modification have to be handled differently. Existing and unmodified records in the table must not be touched. I can access the columns by using APEX_APPLICATION.G_Fxx() but how do I recognize modifications? In a thread in this forum I found information about using a MD5 checksum. So I have added a checksum field using APEX_ITEM.MD5_HIDDEN() and tried to check this information. Unfortunately, doing this, I already get a problem when I submit the page after having added an empty record by clicking on "add row" but without having supplied any information. APEX then complains about information that has been modified in the meantime instead of just ignoring the empty record. This is probably because APEX considers the record as changed because of the checksum column I have added (I have read that the SQL query to create the tabular form must not be altered).
Could anybody please show me the right way to do such a check?
Thank you very much for your help.
Best regards,
Ralf GorholtHi Ralph,
Well, if you are wanting to check if anything has been updated before the update button is pressed, using JS, you can use the property of the field 'defaultValue' and compare it to the property 'value'
i.e. for the text input type
function isElementChanged( myElement ) {
var iselementChanged = false;
var returnVal = false;
switch ( myElement.type ) {
case "text" :
if ( myElement.value != myElement.defaultValue )
return true;
break;
default
return false;
} You could cycle through all elements, by:
allEls = form.elements;
for (i=0; i < allEls.length; i++){
if ( allEls.type != undefined && allEls[i].type.length > 0 && allEls[i].disabled == false ) {
if (isElementChanged(allElls[i])) {
//TODO: logic here
}Ta,<br />Trent -
TABULAR FORM UPDATE ERROR CURRENT VERSION OF DATA IN DB HAS CHANGED...!
Hi all Experts on Apex 423 and Oracle xe 11g r2...
I'm getting a systematic error when updating a Apex Tabular form : the Oracle internal engine complaining that the row ID's are out of syncr? I'm use ROWID instead of ID ( trigger has been created but I think should not used ...!)
Any advise.
remark: The SIMPLE DATA APPLICATION has the same issue when trying to update the QUANTITY field on ORDERS... STRANGE NOT?
MFOConsulting Switzerland
[email protected]Hi All Apex Experts,
Détails with Détails records in a TABULAR FORM .
I tranformed this program Master-Détails with Détails records in FORM ( not tabular) and this error message is no more displayed on the screen.!!
CONCLUSION: there is a SERIUOS BUG in Apex 423.00.08 and 424.00.008!!
I hope that People in Oracle Corporation is working on this bug. and the next release of Apex 5.0 will correct it.
PS: The SIMPLE DATA BASE installed with any version of Apex... display this MSg .( update ORDERS quantity of items and you recieve thiS fanny message!
MFOConsulting Switzerland -
Tabular form Update Error,"Current version of data in database has changed
I'm getting an error when updating a Apex Tabular form. It's complaining that the row id's are out-of-sync. The error reads,' Current version of data in database has changed since user initiated update process. current row version identifier = "56DW5A8A7EBA3B42073AE6E71480A784" application row version identifier = "99B52A15F10E34647E9E18B6B7AE8C30" .
Has anyone received this error? Any solutions? Note that the primary is being populated by a trigger. I have another tabular form for a different application that updates without issue, this however, uses a sequence to update the primary key.
Thanks,
JamesMake sure that the form is defined such that it "knows" that the PK is being set by a trigger. Do not try to set it in the form if the trigger is doing it. Pretty much if a trigger attempt to modify any column that also was editable (including hidden columns) in the form, the two will conflict.
The other issue could be that do you have any items on the rows that are disabled? Disabled items are not sent to session state so Apex won't be able to properly compute the checksum and it'll find a discrepancy. -
Second LOV based on First LOV in Oracle APEX tabular Form
Hi,
I had created a tabular form in which I am having two LOV's. This form is based on a query.
I had created a javascript function which internally calls AJAX and populates the second LOV based on the value selected in first LOV when onchange.
But the issue is, when the user recalls this APEX page to view the details or edit the details, the second LOV shows all the values instead of showing only the values related to first LOV.
In the second LOV query I am trying to write the below query.
select function_name fn
,function_code_id fci
from catering_function_codes
where function_type_id = NVL(#FUNCTION_TYPE_ID#,function_type_id)
order by to_number(function_code_id)
in which #FUNCTION_TYPE_ID# is the value of first LOV. But I am getting the below error.
report error:
ORA-20001: Error fetching column value: ORA-06550: line 1, column 187:
PL/SQL: ORA-00911: invalid character
ORA-06550: line 1, column 7:
PL/SQL: SQL Statement ignored
How can you refer to the Second LOV the value of First LOV in a report based tabular form?
Kindly let me know if you do not understand the issue.
Please help me in this issue.
Thank you
Regards
DevHi Roel,
Thank you for the quick reply.
I used the query as given by you. This time it is not giving any error but showing all the values in the second LOV irrespective of what ever value is present in the first LOV
This is an apex tabular form which is generated by apex based on a query. The controls will be dynamically generated by APEX for each row. How can we hard code the control name to :P99_FUNCTION_TYPE_ID?
Please help me in this issue. Thank you
Regards
Dev -
Insert and update in database using apex tabular form
Hi All,
i have tabular form
category_ID
Day
Hours
Start Date
End Date
1001
2
3
01-jun-2013
Null
1002
1
4
02-jun-2013
Null
1003
2
5
03-jun-2013
null
if day or hour change/update then End date will be sysdate.
and new row insert in table
category_ID
Day
Hours
Start Date
End Date
Header 6
1001
1
3
01-jun-2013
04-jun-2013
Day change from 2 to 1
1002
1
4
02-jun-2013
Null
No change
1003
2
5
03-jun-2013
null
No change
1001
1
3
04-jun-2013
null
New record insert which is change/update
how to achieve it.
Thanks in advance,
PrashantI usualy don't use the apex wizards to create forms when you need such custom functionality.
I just make the needed items, and when saving the form elements to the db i run my own written procedure en i submit the page with the request 'UPDATE' and i also set an id item with the newly created id for the inserted record.
So the page knows it should call the procedure that fills up all items with the values of the record i just saved. this also comes in handy when inserting a form in multiple tables. -
Apex_Item.radiogroup in a Tabular Form (Update Only, no Insert)
Hi,
I'd like to use a radiogroup on a tabular Form. The Form will modify only existing records.
I've seen some more elaborate examples for Tab Forms that allow Insert.
But I am trying to use the APEX_Item.radiogroup function for an example like:
"Select Chairperson_Name, Approve_Status FROM Chairperson_Approval"
The Approve_Status column can be 'A' for Accept, or 'R' for Reject, and is the only updateable column in the Tabular Form.
So I should be able to create a Tabular Form (for Update Only) on the table Chairperson_Approval with the wizard.
Then I want to be able to go into the Source and change the SELECT statement to something like:
"Select Chairperson_Name, APEX_Item.radiogroup(1,approve_status,.....) FROM Chairperson_Approval"
and then let the automatic APEX processing (generated by the wizard) do the rest. Right? Can
anybody give me an exact example for APEX_Item.radiogroup. My documentation is not clear enough on this function.
Thank you very much, in advance.
CarolHi Andy,
Why do you get & set TEST attribute of the radiobutton?
What is a TEST attribute?
getAttribute("TEST") == 'Y')
setAttribute("TEST","Y");So I was thinking I should incorporate this toggle me function with my radiobutton and have the following inside the toggleMe function.
$x(''P24_SECONDARY_TASK'').value=' || ad.task_id || '"')
{code}
Am I right?
Cheers
-Joel -
Hi everyone,
I am working on apex 4.1, oracle 11g database.
I have a tabular form with a first column of checkboxes.
I want to check all the rows taht interest me, and update them with a value from a select list.
It is exactly as if i wanted to delete the checked rows, only that i want to update them all with a value.
Can anyone help me with this?
I can't seem to find a way to select the rows that are checked.
Thank you,
Alex.See this http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_app.htm#CHDICJDA
-
Tabular Form update,delete
Hi,
I am using database 11G, on windows XP with apex 3.0. I have created a tabular form with update & delete buttons. The table is a detail table having foreign key columns. On creation of form I choose foreign key column as primary key. The problem is when i check one row for delete the rows having same id on foreign key column are also deleted. Second When I update the following error is reported & no column is updated,
Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-20001: ORA-20001: Current version of data in database has changed since user initiated update process. current checksum = "197D508D2444826DA98FC1E3D259EA31", item checksum = "F98E67DE7FF4EC9710E5A1B052E38C78"., update "HT"."INTRA_ORAL_EXAM" set "OPD#" = :b1, "TOOTH#" = :b2, "RESTORATION" = :b3, "DENETAL_DECAY" = :b4, "XRAY" = :b5, "SYMTOM" = :b6
Error Unable to process update.
need help
SajjadHi,
OK - that makes it a bit more complicated as you can not add a primary key to a table that contains data. This means that we will have to copy the data into a temporary table first.
Assume that you have a table called C_TABLE that is defined as:
CREATE TABLE C_TABLE
FIELD1 NUMBER,
FIELD2 NUMBER
)These are the steps that you need to do (each of these bits of code run be run separately):
Firstly, copy the data into a new table:
CREATE TABLE C_TABLE_COPY
AS
SELECT FIELD1, FIELD2
FROM C_TABLECheck that the table has been created:
SELECT * FROM C_TABLE_COPYThen drop the existing table:
DROP TABLE C_TABLECreate C_TABLE with a new Primary Key column:
CREATE TABLE C_TABLE
C_ID NUMBER,
FIELD1 NUMBER,
FIELD2 NUMBER,
CONSTRAINT "C_TABLE_PK" PRIMARY KEY (C_ID)
)Create a new SEQUENCE object to provide the primary key with values:
CREATE SEQUENCE "C_ID_SEQ" MINVALUE 1 MAXVALUE 99999999999999999999999 INCREMENT BY 1 START WITH 1 NOCACHE NOORDER NOCYCLECreate a new TRIGGER object to populate the primary keys with new SEQUENCE numbers when new records are added to C_TABLE:
CREATE OR REPLACE TRIGGER "C_TABLE_BI"
BEFORE
INSERT ON C_TABLE
FOR EACH ROW
DECLARE
v_id NUMBER;
BEGIN
BEGIN
IF :NEW.C_ID IS NULL THEN
SELECT C_ID_SEQ.nextval INTO v_id FROM dual;
:NEW.C_ID := v_id;
END IF;
END;
END;Enable the trigger:
ALTER TRIGGER "C_TABLE_BI" ENABLECopy the data back into the table:
INSERT INTO C_TABLE (FIELD1, FIELD2)
SELECT FIELD1, FIELD2
FROM C_TABLE_COPYCheck the new table has primary keys:
SELECT * FROM C_TABLEAndy -
Apex, Tabular forms and Nested Tables := Headache
Hi All,
I'm constructing an Apex aplication for Performance Reviewing staff and I have need of nested tables within each line item for ongoing comments during the year, the headings of which are drawn from another table, based on a template for which ones are to be used at any given time.
I'd like to be able to use a tabular form to draw out the history of comments at any given time and modify them however I'm at a complete loss as to how to get this working with a tabular form in Apex. If anyone could point me at some good documentation on the subject or even suggest a better method to get this done I'd be very grateful.
Thanks!Hi,
Take a look at this article:
http://www.oracle-base.com/articles/misc/ObjectViewsAndNestedTables.php
First, create a view as described on your nested and other table(s), with 'Instead Of' triggers handling the DML. Next create the tabular form based on the view. You'll find many posts in the forum regarding building a tablular form based on a view.
Paul Brookes. -
Manual tabular form "Update Process"
Hello,
i made a tabular form manually,
now i want to add an update process, but its not working?
I created a Button "P_UPDATE" and i added a Process which listens to the P_UPDATE Button.
i used the following PL/SQL script:
for i in 1..htmldb_application.g_f01.count
loop
update MATCHUMSATZ
set PARTNER_ID = replace(htmldb_application.g_f10(i),'%'||'null%',NULL),
RECH_DATUM = replace(htmldb_application.g_f02(i),'%'||'null%',null),
RECH_NR= htmldb_application.g_f06(i),
PROV_GRUNDLAGE= htmldb_application.g_f08(i),
KUNDE= htmldb_application.g_f14(i),
VERTRIEBSART_ID = replace(htmldb_application.g_f17(i),'%'||'null%',NULL)
where id = htmldb_application.g_f01(i);
end loop;
This is an example which i customized from: http://www.oracle.com/technology/products/database/application_express/howtos/tabular_form.html
I suppose that 'htmldb_application.g_f01' is the ID of the table 'MATCHUMSATZ'.
Why is there replace() and sometimes not ?
Would be glad if anybody could help me!
PhilHi Phil,
You can add in the in-built MRU update process that will do this for you. When you add a process, select Data Manipulation then Multi Row Update, then follow the prompts to link it to your table.
In your code snippet, htmldb_application.g_f01 refers to the first column in your form (even if this is hidden). Normally this is the Primary Key for the table on which the form is based. htmldb_application.g_f02 refers to the second column and so on, although you can assign any number from 1 to 50 to each field when you create the sql statement.
The replace() function is used because some of the fields will contain %null% which needs to be converted to null before updating the table.
Regards
Andy -
Dears ,
i have manual tabular form
select htmldb_item.checkbox(1,rownum) " ",
x.service_id,
x.service_name,
htmldb_item.checkbox( 4, flag,decode( flag, 1, 1, 0) ) flag
from (
select htmldb_item.hidden(2,c.service_id) service_id,
htmldb_item.text(3,s.service_name) service_name,
htmldb_item.checkbox( 4, flag,decode( flag, 1, 1, 0) ) flag
from CUST_SERVICES c,SERVICES s
where c.service_id=s.service_id
and c.cust_id=:p6_customer_id) x
order by 2and make process to save
Type: PL/SQL anonymous block
Process Point : on submit - after computation and validation
Run Process : once per page visit (defult)
source code :
for i in 1..htmldb_application.g_f01.count
loop
update CUST_SERVICES set flag = htmldb_application.g_f04(htmldb_application.g_f01(i));
-- where CUST_ID=:p6_customer_id
-- and SERVICE_ID =htmldb_application.g_f02(htmldb_application.g_f01(i));
end loop;put it's not save , please helpHi Phil,
You can add in the in-built MRU update process that will do this for you. When you add a process, select Data Manipulation then Multi Row Update, then follow the prompts to link it to your table.
In your code snippet, htmldb_application.g_f01 refers to the first column in your form (even if this is hidden). Normally this is the Primary Key for the table on which the form is based. htmldb_application.g_f02 refers to the second column and so on, although you can assign any number from 1 to 50 to each field when you create the sql statement.
The replace() function is used because some of the fields will contain %null% which needs to be converted to null before updating the table.
Regards
Andy -
ORDS v3 and APEX tabular form issue
Hi,
We encountered strange issue after installing ORDS v3 EA to test, thought I would report this. I'm not sure if its a bug but it seems to be reproducible in our instance.
Steps:
1) Install ORDS v3 with Glassfish deployment.
2) Go to APEX builder -> Page with report (classic or interactive) -> Edit Attributes -> Change data in column attempt to save throws out "ORA-01403: no data found"
or
3) Create APEX app -> Build page with DML form and Tabular form -> Edit tabular form attempt to save throws out same error.
Application error logs shows:
ORA-20987: APEX - Unable to change column attributes. - ORA-01403: no data found
WWV_FLOW_SECURITY
FINAL_EXCEPTION_HANDLER
Also, I was unable to get RESTFul services working with APEX no matter how I configured ORDS v3. I don't encounter these issues when reverting back to version 1.x , 2.x
APEX Version: 4.2.6.00.03
Oracle DB: 11.2.0.3.0
Glassfish : open source edition 4.1
Regards,
-SenthilI too am getting ORA-01403 both when trying to save in the builder and when just hitting submit on the tabular form when using standalone EA3. Happens when pointing at 4.1 or 4.2.6. The v2 listeners works fine when pointing to the same applications/pages.
I asked oracle support whether it is a known EA3 issue but was told to add my observations to the forum.
cheers
~t -
Row level cascading in Apex tabular form
Hi,
I have searched alot,but i am not able to find the solution
I have a tabular form and having only one column say column A is dynamic LOV (Select col1 from lov_table will return values as 1,2,3........)
When user press ADD ROW button
row 1 => column A display LOV as _1,2,3.... then if user selects 1
When user press ADD ROW button
row 2 => column A "should" display LOV as 2,3,.....
Anyone could help me out to solve this problem......
Regards,
VenkatHi,
steps i followed:---
i created a dynamic action
event--- change
select type --jquery selector
jquery selector--[name="f05"]
action--Execute PL/SQL Code
script---
DECLARE
V_COLLECTION_NAME VARCHAR2 (30) := 'XXBCT_GPMS_COL';
V_ITEM_ID NUMBER;
L_SEQ_ID NUMBER;
L_ITEM_VALUE NUMBER;
BEGIN
IF NOT apex_collection.collection_exists (p_collection_name => v_collection_name) THEN
APEX_COLLECTION.CREATE_OR_TRUNCATE_COLLECTION (P_COLLECTION_NAME => V_COLLECTION_NAME);
END IF;
V_ITEM_ID := (APEX_APPLICATION.G_X01);
SELECT MIN(seq_id)
INTO L_SEQ_ID
FROM APEX_COLLECTIONS
WHERE COLLECTION_NAME = V_COLLECTION_NAME;
IF L_SEQ_ID IS NULL THEN
APEX_COLLECTION.ADD_MEMBER ( P_COLLECTION_NAME => V_COLLECTION_NAME, P_C001 => V_ITEM_ID );
END IF;
FOR i IN 1..apex_application.g_f05.count
LOOP
SELECT SEQ_ID,
C001
INTO L_SEQ_ID,
L_ITEM_VALUE
FROM APEX_COLLECTIONS
WHERE COLLECTION_NAME =V_COLLECTION_NAME;
IF L_ITEM_VALUE !=V_ITEM_ID THEN
APEX_COLLECTION.ADD_MEMBER ( P_COLLECTION_NAME => V_COLLECTION_NAME, P_C001 => V_ITEM_ID );
ELSE
APEX_COLLECTION.UPDATE_MEMBER ( P_COLLECTION_NAME => V_COLLECTION_NAME, P_SEQ => L_SEQ_ID, P_C001 => V_ITEM_ID);
END IF;
END LOOP;
END;
affected elements-->no
event scope--dynamic
--->for tat tabular form column
SELECT DISTINCT msib.DESCRIPTION,
msib.INVENTORY_ITEM_ID
FROM MTL_SYSTEM_ITEMS_B MSIB,
ORG_ORGANIZATION_DEFINITIONS OOD
WHERE MSIB.ORGANIZATION_ID =OOD.ORGANIZATION_ID
AND OOD.BUSINESS_GROUP_ID =FND_PROFILE.VALUE('PER_BUSINESS_GROUP_ID')
AND MSIB.INVENTORY_ITEM_ID NOT IN
(SELECT AC.C001
FROM APEX_COLLECTIONS AC
WHERE AC.COLLECTION_NAME ='XXBCT_GPMS_COL'
ORDER BY msib.INVENTORY_ITEM_ID
but this script is not working ...
collection itself not creating i don't know y..
kindly help me to solve this problem....................
Thanks,
Venkat -
Forms need to get next record value in tabular forms, update # on delete
the isusue
In a tabular form (multirecord)...when i enter + to add the first record , it should add 1 in this item 'order' and if i hit + again then it should enter 2 and so on....
where users would enter different records at once and save it .However if they were to delete a record in the middle ...
say record
1
2
3
4
5
6
and delete 2 and 3 then # 4 should be 2 and # 5 should be 3 and #6 would be 4 . if they are to add a new record then it should assign the next number which would be 5
what i have done is created a non database item in that block and made it a summary field with max
and in the when_new__record_instance trigger...i am doing somthing like
If block.item is NULL
THEN
block.item = block.non_database_item +1
end if
got this from a post here by Francois...
it is adding just 1 everytime i hit + to add a new record...when the item is null in the beginning. However if i save the first record then click + to add new record then it goes inseries like 2..3..4....
Any help would be appreicated . ThanksHI,
Check following thread you may useful
Maximum create call for the VO
Maybe you are looking for
-
How to reset my macbook admin password
how to reset my macbook pro admin password
-
Photo Stream is not showing up anywhere on my iPad3.
Is there an issue with Photo Stream? I have used it once on my iPad 3, but now I can't seem to find any trace of it. My software is up-to-date, but Photo Stream and its setting options are not being listed anywhere. Not listed under Settings--iCloud
-
Error message while downloading. :Compressor Failed to Download. An Error has occurred. Use the Purchases page to try again." After retrying, I receive the same message. I have uninstalled compressor and tried again. I get same results.
-
Iphoto froze then lost all photos-Help!
Iphoto froze so I forced it to quit several times. Then i did a safe boot and restated machine. It would then open but all photos are gone. How do I restore them?
-
Lately when I view videos online in Safari (YouTube, Brightcove, etc.), the video playback lags significantly. I have tried allowing the full clip to load and then playing, but the problem still persists. I have a PowerBook G4 15" aluminum with a 250