Problem in populating next record in Tabular Form
on my Tabular form i have fields like :
VOY_REF, VISIT_NUM, FM_PORT_CODE, TO_PORT_CODE
when the user enter the visit number 2 i wanted to populate TO_PORT_CODE as 2nd visit's FM_PORT_CODE.
my code is working fine when every visit been saved before entering the next visit.
is there any way out without saving every row the user can enter all the visits and commit_form at the end?
WHEN-VALIDATE-ITEM Trigger
IF :TT_VOY_SCHEDULE.VISIT_NUM > 1 THEN
DECLARE
FMPORT VARCHAR2(5);
CURSOR C1 IS
SELECT TO_PORT_CODE
FROM TT_VOY_SCHEDULE
WHERE VISIT_NUM = :TT_VOY_SCHEDULE.VISIT_NUM - 1
AND VOY_REF = :TT_VOY_SCHEDULE.VOY_REF;
BEGIN
OPEN C1;
FETCH C1 INTO FMPORT;
:TT_VOY_SCHEDULE.FM_PORT_CODE := FMPORT;
CLOSE C1;
END;
END IF;
basically i'm directly calling the TO_PORT_CODE value from the table TT_VOY_SCHEDULE. after commiting the Form only the data gets saved in the table. so when i call TO_PORT_CODE from the table it gives wrong detail.
that why once i enter a row i save the data so the table get updated. then i enter the 2nd line the information populate correct.
on your code you mean to say that i don't need to use cursor?
Similar Messages
-
Triger for display next record in oracle forms
hai all,
i want to do
when new form opened i have to add new reord that is empty new form also my new rownum will be displayed.
now i getting first record.
like:
GROUP_ROWNUM: 1
GROUP_ID: 120130
GROUP_NAME aaaaaaaaa
need like:
GROUP_ROWNUM: 7
GROUP_ID:
GROUP_NAME
that can be done by
trigger for display next record in oracle forms?
or through property seting?
thanks in adv,
rcs
--------YES, this block is base on the DB table
through defualt navigational button i can go to next,last,new record
but i want create seperate form for new entry, in that i want to display
old rownum
formula to get rownum automatically (i am not at all typing it is system generated)
even though i created column group_rownum for rownum
(i can't be typing)
LAST_RECORD;
NEXT_RECORD; also not getting the next rownum
i hope now understand me
any posible way?
thank you for your good input
i.e.
SQL> DESC GROUP_MSTR1;
Name Null? Type
GROUP_ID NOT NULL NUMBER(10)
GROUP_NAME NOT NULL VARCHAR2(30)
SQL> select * from GROUP_MSTR1;
GROUP_ID GROUP_NAME
123 AAAAAA
124 BBBBBBBB
125 CCCCCCCCC
126 DDDDDDDD
1 eeeeeeee
2 FFFFFFFFF
3 ggggggg
7 rows selected.
SQL> select rownum, GROUP_ID, GROUP_NAME from GROUP_MSTR1;
ROWNUM GROUP_ID GROUP_NAME
1 123 AAAAAA
2 124 BBBBBBBB
3 125 CCCCCCCCC
4 126 DDDDDDDD
5 1 eeeeeeee
6 2 FFFFFFFFF
7 3 ggggggg
7 rows selected.
------------- -
Create NEXT RECORD button on form
I want to create a NEXT RECORD and PREVIOUS RECORD button on my form. how do I do this so that the buttons are function.
Review the discussions at
http://forums.oracle.com/forums/search.jspa?threadID=&q=get+next+record+process&objID=f137 -
Sending emails for each record from tabular form
I currently have a requirements management tabular form that used to update or set job requirements inactive and/or covered.
We're a staffing agency and have salesmen across the country that will use this tabular form to quickly manage their requirements to mark them as covered or inactive if the position has been filled.
The multi-row update works fine since the form was built using the wizard, but I need to be able to send out an email for each record that's been marked as covered in the tabular form.
How can this be accomplished?
I'm running Oracle 12c and Apex 4.2.0 on a windows 2008 R2 server.
Thanks again.Greg,
I took a different approach from what I originally suggested. Since the tabular form is displaying only reqs that eligible to be covered, I chose to construct a process that would read the database after the reqs table was updated. The code should find recent reqs covered by the salesman and then send out an email for each covered req.
Since I cannot see the data structure of your reqs table, I guessed the data type and size for the local variables in the DECLARE section, you many need to adjust these.
Give this code a shot and let's see where we get. By the way, the naming conventions of your database are in need of naming standards.
The process needs to occur After Submit and after the Automatic Row Processing (DML) process that is updating the reqs table. Make sure that the process sequence number is greater than the Automatic Row Processing (DML) sequence number.
DECLARE
l_id NUMBER;
l_index NUMBER;
l_vc_arr2 apex_application_global.vc_arr2;
lc_message VARCHAR2 (4000);
l_pkey NUMBER;
l_date_wrote DATE;
l_sales VARCHAR2 (100);
l_client VARCHAR2 (100);
l_job VARCHAR2 (100);
l_1or2 VARCHAR2 (100);
l_rate NUMBER;
l_notes VARCHAR2 (4000);
BEGIN
FOR c1
-- Retrieve reqs primary key that have been covered
-- in the last 2 seconds by the salesman
IN (SELECT pkey
INTO l_pkey
FROM reqs
WHERE SYSDATE < (date_wrote + 1 / 46200)
AND active = 'Active'
AND reqs.sales = :p12_sales
AND covered IS NOT NULL)
-- Send an email for each req that has been covered
LOOP
SELECT c1.date_wrote,
c1.sales,
c1.client,
c1.job,
c1.notes,
c1.who,
c1.1or2,
c1.rate
INTO l_date_wrote,
l_sales,
l_client,
l_job,
l_notes,
l_who,
l_1or2,
l_rate
FROM reqs
WHERE pkey = l_pkey;
lc_message := 'Date Written :' || l_date_wrote || CHR (10);
lc_message := lc_message || 'Sales :' || l_sales || CHR (10);
lc_message := lc_message || 'Client :' || l_client || CHR (10);
lc_message := lc_message || 'Position :' || l_job || CHR (10);
lc_message := lc_message || '#1 or #2 :' || l_1or2 || CHR (10);
lc_message := lc_message || 'Rate :' || l_rate || CHR (10);
lc_message := lc_message || 'Notes :' || l_notes || CHR (10);
l_id :=
apex_mail.send (
p_to => '[email protected]',
p_from => 'DO_NOT_REPLY@REQS',
p_subj => ''
|| l_who
|| ' Has Covered '
|| l_job
|| ' at '
|| l_client
|| CHR (10),
p_body => lc_message);
COMMIT;
apex_mail.push_queue ();
END LOOP;
END;
Jeff -
Hi All,
How I can move to next record (when a condition applies)?
In other words I need the object (or sample code) that perfoms the "Next Record" in navigation menu.
Thanks All,
VangelisHello,
use following statement
SBO_Application.ActivateMenuItem("1288")
where SBO_Application is the UI API application object.
Rahul -
Problem with inserting new records in Oracle Forms
Hi Friends,
I am a new user to Oracle Forms and I need a help from you people. The problem is as follows:
I have a data block in which I can display a number of records. In this data block the user will be able to edit the fields if no child records are found in another table. I have used when-new-record-instance to attain this scenario. All are text items. One item licensee_id which is made invisible by setting the property in property palette and required=no ( as this is the primary key of the table). Also the audit columns are made invisible.
The code for it is as follows:
DECLARE
v_alert_button NUMBER;
v_cnt NUMBER;
BEGIN
SELECT COUNT (*)
INTO v_cnt
FROM id_rev_contracts
WHERE licensee_id = :ID_REV_LICENSEES.licensee_id;
IF v_cnt > 0 THEN
set_item_property('ID_REV_LICENSEES.LICENSEE_NAME', UPDATE_ALLOWED, PROPERTY_FALSE);
ELSE
set_item_property('ID_REV_LICENSEES.LICENSEE_NAME', UPDATE_ALLOWED, PROPERTY_TRUE);
-- set_item_property('ID_REV_LICENSEES.LICENSEE_NAME', INSERT_ALLOWED, PROPERTY_TRUE);
END IF;
END;
Now in this data block I should also be able to insert new records and for the same I have used PRE-INSERT trigger and the code for it is as follows:
DECLARE
v_alert_button NUMBER;
CURSOR v_licensee_id IS SELECT id_rev_licensees_s.NEXTVAL FROM dual;
BEGIN
OPEN v_licensee_id;
FETCH v_licensee_id INTO :id_rev_licensees.licensee_id;
CLOSE v_licensee_id;
IF :id_rev_licensees.licensee_id IS NULL THEN
Message('Error Generating Next v_licensee_id');
RAISE Form_Trigger_Failure;
END IF;
:ID_REV_LICENSEES.created_by := :GLOBAL.g_login_name;
:ID_REV_LICENSEES.last_updated_by := :GLOBAL.g_login_name;
:ID_REV_LICENSEES.create_date := SYSDATE;
:ID_REV_LICENSEES.last_update_date := SYSDATE;
EXCEPTION
WHEN form_trigger_failure
THEN
RAISE form_trigger_failure;
WHEN OTHERS
THEN
v_alert_button :=
msgbox ('ERROR in Pre-Insert - ' || SQLERRM, 'STOP', 'Contact IST');
RAISE form_trigger_failure;
END;
Every thing is compiling fine but at the run time when I am trying to insert a new record I am receiving the following error:
FRM-40508:ORACLE error:unable to insert record
I also think the pre-insert record is not firing at the time of inserting a new record and saving it. So I request you to please delve into this problem and suggest me how to overcome this problem. Code snippets would do more help for me. If you need any other things from me please let me know. I will see if I could be of any help in that concern because I may not be able to send the entire form as it is.
Thanks and regards,
Vamsi K Gummadi.first of all
pre-insert fires after the implicit/explicit commit/commit_form is issued and before the real insert is submitted to the db.
i would suggest to remove the error handling part for the moment
because i believe you might be getting "ora-xxxx cannot insert null"
and also make visible the primary column to check if the pre-insert is executed.
it would be better to make visible for a while the not null columns of the table/block
i suppose that the block is insert allowed and you are using table as the source of the block and not any procedures or something... -
Problem while populating a field on process form- Values truncated
Hi,
I am facing a strange problem.
I have a requirement to populate Country field on AD process form based on the value of country code on the same process form which should eventually go to 'co' attribute in AD. So for eg. if the Country Code has value- 'US' then the Country field should be populated with 'United States'. This value is picked from lookup- Lookup.Locations.Country.
My adapter code works perfectly fine (checked using sysouts) it gets the proper values from the lookup but the country filed gets populated only with partial value. So instead of United States it only shows 'UNIT'. Same is for any country having more than 4 charatcters. It truncates the rest of the string and populates the field with only first 4 characters. I tried manually populating the Country field with complete country name on the process form and it works fine and the same value goes to AD also but when I run the adapter it only populates it with 4 charactetrs.
This is strange and I have no clue what could be stopping it. Any idea/experiences?
Thanks in advance,
-AbhiHi Abhi,
Can you tell me how you have implemented populating an UDF based on Prepopulation of another UDF. I have a similar kind of requirement. It would be great if you share your code or relevant part of it.
Regards,
Sunny Ajmera -
Adding a Record in Tabular Form
I created a tabular report using apex_collections. Now I have created by apex_collection.add_member . It is successfully adding a new record. But I need to jump off to the last screen to view the blank record.
Any solution to display that in the current page or jump off to the last page when the "Add Record" button is clicked.
Thanks
DebHi,
Your newly added row is going to the bottom possibly because you have given 'ORDER BY SEQ_ID' in your region query. The ADD_MEMBER apeends, so the new row goes to the bottom.
You have to make the new row appear on top. The options are
Option 1:
Use the apex_collection.MOVE_MEMBER_UP and MOVE_MEMBER_DOWN API to take new member to SEQ_ID = 1
You can perform this resequencing in a process that is conditionally executed in Add Rows.
Option 2:
Add a sorting column to your query
select .......from ......where....
order by decode(<pk_col>,null,0,1), to_number(seq_id)
order by Of course, if you change the Order By clause then you will need to make identical change in Validations , Computatiosn and Processes where you are working on the Collection.
Regards, -
I have a form that logs fibre analysis for asbestos analaysis. Let's say I am analysisng 2 samples. I log all the details for the first sample and hit save. Now I use the scroll button to move to the next sample. When the screen refreshes all the entries for the first sample are still showing on the screen. But these are just phantom entries, when I look at the back-end database there are of course no entries against the second sample. This does not occur with any other browser.
I have tried clearing the cache to no avail.
Any ideas?Is Firefox filling the form via the cache or via saved form data?
If this data still gets filled when "Remember search and form history" is disabled the Firefox fills it from the cache.
*Tools > Options > Privacy > Firefox will: "Use custom settings for history": "Remember search and form history"
In such a case a hard refresh via Ctrl + F5 might help to reset the form data. -
Serious problem with previous / next record in master-details relations
I have master-details relations like this (if master is A) :
A-B
A-C and C-D
When I move down with do_key('next_record') all values of all records in all blocks are OK. But when I move up, it doesn't work : all D block values are erased and I don't understand why ?
Thank you for your help.
Antoine LEFEBVRE.Blocks A and B are in the first canvas and blocks C et D are in the second canvas.
On next_record action from A the B is updated, C too and D too. But on previous_record action, D is not updates.
To display the second canvas I use a command button and into the WBP trigger there is :
go_block(C);
execute_query;
to be sure to execute query, but it's null.
What's your suggest ?
Thank you,
Antoine. -
Problem with my tabular form report repeating columns
hello,
i have a problem like, I have created a tabular form report and I have just copied the page to an another new page in the same application.
once i copied the page to a new page, and when i tried to run the report the columns are repeating. I ahve seen the report attributes, in the new page they were repeating. I am not able to understand what might be the problem.
can anyone plz sort it out this problem.
thanks.hi,
Copy page will never repeat columns anywhere in page ... this s just a suggestion..
delete the new page and try once again the copy of Tabular form page. if still come problem then we can solve it by some other way !
Thanks
Mark Wyatt -
Button tabular form strange behaviour
Hello everibody.
Working with Oracle 10G Forms & Database.
I have a tabular form. In this I have some buttons added to every row of tabular.
I use a Access Key to can execute any of those buttons.
The problem.
If I use the Access Key the trigger fired ever use the data of 1º record in tabular form, maybe Im situate in 5º record if I use access key the trigger take the data of 1º record. If I clik ,whith mouse on the button it take the properly record data.
Any idea wellcome.
Thanks in advanced to all.Access-Keys will not work properly in a tabular form. The access-key should be unique to the form, if there is more than one time the same access-key, the first one fires, and in a multirecord-block the first one is the first record.
-
Dynamic LOV FOR TABULAR FORM 6i
Hi,
I have tabular form of two Items(ID,DESC) and I want to Populate LOV for item(ID) every record
and record_Group & SQL statments are stored in DB.
ACTION: when query in POST-QUERY Trigger get for every record in tabular form -- the stored SQL-Statment from table then put it into dynamic record_group and populate the dynamic LOV.
Please advice,
Thanks in Advance.OK daniel
This form used for get reports
then header get the name of Report (Table-A) (report_ID),(report_desc).
then details for get the Parameters will send to report builder (Table-B) (detail_id),(report_id),(sql_stm).
so parameters may be need for example stock code so this record need to query from stocks table to get stock code and stock name.
next record for item Code so need to query from Items table to get the Item code and Item name
another report for employees so the user enter report code then when query and get in details block employee code and employee name.
so the lov will check if this record have query sql-statment or not if have execute it in the record_group then in lov
then go to the next record if sql_stm is null then no lov in this record and so on.
thanks.. -
Enable/Disable item Based Value from Select in Tabular Form
Hi Guys
I want to Disable text field in Tabular form, Based on the Select List Item Value.
Let's Say
I'm having one select lista and text box in each record in tabular form.
Select List having 2 items ... Add Text(return value 1) and No Text(return value 2)
if value =1 then i want to enable text box , so user can enter value.
if value=2 then text box won't allow to add text or will become disalbe.
Please Help
ThanksHi,
You can do this by using a small java script
<script language="JavaScript" type="text/javascript">
<!--
function FldEnableDisable(pThis)
if (pThis == 50)
$x('P2_TEXT').disabled=true;}
else
{ $x('P2_TEXT').disabled=false; }
//-->
</script>Here P2_Text is the text box whose value I am enabling or disabling based on the selected value from a List box. On The list box I have onChange="javascript:FldEnableDisable(this.value)" ( You can specify this under HTML Form Element Attributes)
Thanks,
Manish Jha -
Stored procedures with view in tabular form
Dears,
i use apex 4.2 and database xe 11g , i have create tabular depend on view and i use stored procedures in process after computation and validation , the problem that view not update
this tabular form query
select
"ROWID",
"DOC_DET_ID",
"DOC_ID",
"MOV_QNTY",
BATCH_DET,
"ITEM_NAME",
"UOM_NAME",
"SIZE_NAME",
"COLOR_NAME",
"STOREG_BRCHAS_BATCHINTERNN",
"EXPR_DATE",
"PROD_DATE",
AVL_QNTY,
storage_code,
"LOCATION_CODE"
from "#OWNER#"."STORAGE_MOV_DET_VIEW"
WHERE DOC_ID =:P117_DOC_IDthis a process that i use stored procedure in it
DECLARE
V_OLD NUMBER:=0;
BEGIN
FOR i IN 1 .. apex_application.g_f02.COUNT LOOP
IF apex_application.g_f02 (i) IS NOT NULL THEN
SELECT MOV_QNTY INTO V_OLD
FROM STORAGE_MOV_DET
WHERE DOC_DET_ID =apex_application.g_f02 (i);
IF apex_application.g_f13 (i) > V_OLD THEN
V_OLD :=apex_application.g_f13 (i)- V_OLD;
END IF;
ELSE
V_OLD :=apex_application.g_f13 (i);
END IF;
if V_OLD <> 0 then
GET_EXTRACT_PARENT_ITEM(apex_application.g_f04 (i) ,
:P117_STORAGE_CODE ,
apex_application.g_f12 (i) ,
V_OLD);
end if;
END LOOP;
END;when i use update this error i found
Current version of data in database has changed since user initiated update process. current row version identifier = "A80CEBCFF06062F98D920BC75CB415AE" application row version identifier = "BCBA67120A87213D64EE059E10F3B15C" (Row 1)please helpDo you still have the Apply MRU process running? I assume you do because otherwise you wouldn't receive the error message. Is the process you are talking about running before the Apply MRU process? It seems it does. Try chaning the execution sequence and run this process after the automatic MRU process.
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.apress.com/9781430235125
http://apex.oracle.com/pls/apex/f?p=31517:1
http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
-------------------------------------------------------------------
Maybe you are looking for
-
All representatives are actively assisting other customers. Your estimated wait time is 7 minute(s) and 0 second(s) or longer. Thank you for your patience. All representatives are actively assisting other customers. Your estimated wait time is 6 minu
-
I have money in an account that i don't use any more and i just simply want to move it into my other account that has all my data on it anyways. I've tried to use the "Send a Gift" option as well, but when i do this it just keeps asking for my passwo
-
Financial Reports 9.3.1.3 Client
I am having problems connecting FR Client (9.3.1.3) with FR Server (9.3.0.1). Is it possible to connect to the server with a newer version of the client. I get an "Unknown Error" Brian Chow
-
Kernel Panic using iPhoto 11 in iMac 7
iPhoto 11 is causing Kernel Panic in my iMac. As far I understand it is not a hardware issue, because the iMac is very very stable with any other softwares.
-
Pavilion dm1-4020sa - Webcam Problem
when i try to use the webcam via skype or HP mediasmart webcam software the webcam light comes on but the video doesn't show then the notebook starts to hang and i need to use the power button to switch off nothing appears in the Windows 7 event logs