Querying a multi-record block within my form
I have a form where I perform validations of items entered on my main block. I compare the item value entered to an expected value and if they are different then an exception record must be created in a separate, multi-record block within my application. One record on my main block may end up with multiple different exception records in the multi-record block. As a result, part of my validation must include determining whether the user has already created an exception record for the item that I'm validating in the multi-record block.
Is there a way for me to query and uncomitted, multi-record block in my form? Help would be greatly appreciated!
Andreas' method is good.
Only several changes:
LOOP... EXIT WHEN :SYSTEM.RECORD_STATUS='NEW';
(Use NEW, not TRUE)
And just before the Raise Form_Trigger_Failure, I would Go_Item to either the item in error, or to a new line in the exceptions block. And also issue an error message.
....By the way...
If your exceptions block has more rows than will fit on the screen, then your search loop function will may cause the rows to jump up or down when the user tries to commit. There is a way to reset the view after the function completes its search -- you just need to store the value of the block's Top_Record property before the First_Record command, and then Go_Record(Top_Rec_value); after the function completes its loop.
Also, there is a way to prompt the user to enter the exception record when you first validate the item in a when-validate-item trigger. But the user might ignore the prompt, so you still need to re-check everything from the key-commit process. To use the WVI prompting, in the WVI trigger you check if an exception is required. If it is, store the item name in a package variable, then start a non-repeating timer. When the timer expires, save the :System.cursor_item value (so you can go_item back to it after calling the function), and then call the function to check for the exception for the item named in the package variable. If not found, prompt the user. If found, go_item back to the cursor_item_value.
Similar Messages
-
Query about multi record block
Abdetu
Please clarify this
I have a multi record group on the canvas, which displays 5 records at a time. The block is based on a table. All the items, except 3 items are displayed items.Now in the block I have a list item, in which I have two values "PO" and "TSF".. If user selects PO, associated text items will get enabled and user will be entering the values .. Same is the case with TSF .. And at the end user selects Ok button to save the record to the database
Now while fetching the records (based on query) ..once the records are fetched, control will be on PO/TSF list box, now the user can either change PO to TSF or TSF to PO ..or he/she may opt not to change also.. If user changes PO to TSF, only that particular record's TSF fields should get enabled .. The problem what I am facing is, when the control comes to PO/TSF list box.. since its multi record block, all the record's PO/TSF list box are getting enabled
In the sense, if control is in the 1st record of multi record block, only those fields should get enabled, once the user navigates to the text item which is the last of that particular record, then 2nd record should get enabled....
Can I know the solution
Regards
Message was edited by:
Seshu
Message was edited by:
SeshuHello Seshu
ur case explanation should be in points 1,2,etc as possible leaving extra lines and spaces in between .. and the case should be more clear and summarized like:
1- I have multi-records data block.
2- I have a static list item with 2 values eg. (a and b).
3- Depending on selecting from the list some items r enabled.etc.
Kindly note that, this will facilitate ur problem to be more readable,recognizable and save time and effort of someone who wants to help u.
Here comes the confusion:
Now while fetching the records (based on query)
The problem what I am facing is, when the control comes to PO/TSF list box.. >since its multi record block, all the record's PO/TSF list box are getting enabled i think with the piece of code i have just posted to u this can't be happened since it disable all the record's PO/TSF.
if this didn't solve ur problem i suggest either u post ur code to help u or u try to put some validations with :
if statment inside the loop depending on the list item's values which will enable or disable related items to the list.
Hope this help u,
If any Questions pls let me know..
Regards,
Abdetu.. -
How to set default settings to display record count in multi record block
Hi All
Whenever I query my multi record block, I get 1/? as record count at the console in standard Oracle Applications. Is there any setting so that it displays 1/50 (in case total record queried is 50). I don't want to set query all property of block as I don't have any control in standard Apps forms.
Thanks in advance
NavdeepCheck out the next_navigation_item option for the get_item_property procedure. If you use this you can do the process without having to navigate from one item to the next.
You can do something like this (untested) to move and resize the items (other than the first in the block):
PROCEDURE move_and_resize(p_item IN ITEM, p_width IN PLS_INTEGER) IS
prev_item ITEM := Get_Item_Property(p_item, PREVIOUS_NAVIGATION_ITEM);
BEGIN
Set_Item_Property(p_item, WIDTH, Get_Item_Property(p_item, WIDTH) + p_width);
Set_Item_Property(p_item, X_POS, Get_Item_Property(prev_item, WIDTH) +
Get_Item_Property(prev_item, X_POS));
END move_and_resize;
move_and_resize(myitem, -30); -
Problem in displaying records in multi record block
Hi all,
I have a problem in displaying records in a multi record block in a form.
I have 1 control block and 1 data block(multi-record block).
Control block has one item CUSTOMER-ID. Data block has many other items related to customer.
when a value is entered in customer-id text item, all the relavant details should be displayed in the data block.
but, the records are overlapping in the same line in the data block, actually they have to be displayed one record per one line.
The code is,
IF :CUST_BLOCK.CUST_ID IS NOT NULL THEN
GO_BLOCK('XBSI_CONTRACT_PRICE_FACTORS');
FOR C1 IN C
LOOP
:XBSI_CONTRACT_PRICE_FACTORS.CUST_ID:=c1.site_use_id;
:XBSI_CONTRACT_PRICE_FACTORS.CAT_ID:=c1.ipc_category_id;
:XBSI_CONTRACT_PRICE_FACTORS.MFG_ID:=c1.mfg_category_id;
:XBSI_CONTRACT_PRICE_FACTORS.INVENTORY_ITEM_ID:=c1.inventory_item_id;
:XBSI_CONTRACT_PRICE_FACTORS.PRICE_BASIS:=c1.price_basis;
:XBSI_CONTRACT_PRICE_FACTORS.PRICE_FACTOR:=c1.price_factor;
END LOOP;
Please help me out..
Thanks in advance!
SumanHi Suman
IF :CUST_BLOCK.CUST_ID IS NOT NULL THEN
GO_BLOCK('XBSI_CONTRACT_PRICE_FACTORS');
first_record;
FOR C1 IN C
LOOP
:XBSI_CONTRACT_PRICE_FACTORS.CUST_ID:=c1.site_use_id;
:XBSI_CONTRACT_PRICE_FACTORS.CAT_ID:=c1.ipc_category_id;
:XBSI_CONTRACT_PRICE_FACTORS.MFG_ID:=c1.mfg_category_id;
:XBSI_CONTRACT_PRICE_FACTORS.INVENTORY_ITEM_ID:=c1.inventory_item_id;
:XBSI_CONTRACT_PRICE_FACTORS.PRICE_BASIS:=c1.price_basis;
:XBSI_CONTRACT_PRICE_FACTORS.PRICE_FACTOR:=c1.price_factor;
next_record;
END LOOP;
Try this. you are trying to show all the records in same line. so its overlapping.
Thankyou
[email protected] -
Record level commit in a multi record block
Dear all,
i have a multi record block in my form (only one block)
after entring record the save buttons commites the form
if any error is raised then total commit processs stop for example if DUP_VAL_ON_INDEX is raised
what i want is that the form shoud act record level,i.e; it should commit record wise so that though a excepton is raised atleast record above that are commited.
thank U
Raj
mail : [email protected]you can have non-database block and write "insert into <table>" statements for each row of block at when-button-pressed of 'commit' button. Commit after each row insertion. This will serve your purpose.
-
Oracle Forms - need to update multi-record block - Help needed asap
Hi,
We are using Oracle apps release 11i - Oracle forms 6i.
I have a field "project_start_date" in project_block in a custom form. There is another multi-record block called role_block in the same custom form and it has a field named start_date. Requirement is when ever I make change in the project_start_date in project_block, that should reflect in role_block.start_date. I tried different means and could update only the very first record of the multi-record block - role_block. I need to update all the records in the role_block with the same project_start_date. Used looping and several other methods. But could not achieve. Any help is really appreciated.
Thanks
AkilHi;
For your issue i suggest close your thread here as changing thread status to answered and move it to Forum Home » Application Development in PL/SQL » Forms which you can get more quick response
Regard
Helios -
Cursor Jumping to last record when query mode for Multi-record block.
I have a multi-record block. the seq field has this validation to check that there should not be a gap
in sequence for S_type and cer_dl field.The program unit is as below.
PROCEDURE seq_validation IS
--Validation to check that there is no gaps in sequence for S_TYPE and cer_dl fields
l_value_to_check varchar2(100);
l_seq_found number;
l_curr_sequence number;
l_new_value varchar2(100);
l_found boolean:=FALSE;
l_new_set boolean := FALSE; --s_type and cer_dl are different from previous set.
begin
if trim(:b1.s_type) is not null
or trim(:b1.cer_dl) is not null
then
-- Program continues here only if all the items are not null
-- Get information from record that needs to be validated
l_value_to_check := trim(:b1.s_type) || ':'|| trim(:b1.cer_dl) ;
l_curr_sequence := :sequence;
if :SYSTEM.CURSOR_RECORD = '1' then
---to check sequence is entered as 1 in the first record
message('Error:Sequence should start with 1');
raise form_trigger_failure;
end if;
go_item('b1.XYZ');
else
FIRST_RECORD;
while :SYSTEM.LAST_RECORD != 'TRUE'
loop
l_found := FALSE;
l_new_value := trim(:b1.S_type) || ':'|| trim(:cer_dl) ;
if l_new_value = l_value_to_check then --
l_new_set:= FALSE;
l_seq_found := :seq;
if l_seq_found >= l_curr_sequence then
go_item('b1.seq');
l_new_set := FALSE;
elsif l_seq_found < l_curr_sequence - 1 then
go_item('b1.sequence');
l_found := FALSE;
elsif l_seq_found = l_curr_sequence - 1 then
l_found:= TRUE;
go_item('b1.xyz); --go to next item
end if;
else
l_new_set := TRUE;
end if;
NEXT_RECORD;
end loop;
if l_new_set then
go_item('b1.xyz'); -- go to next item
else
if not l_found then
message('Error:Sequence should be in order.');
go_item('b1.seq');
raise form_trigger_failure;
end if;
end if;
go_item('b1.xyz'); ---go to next item
end if;
end if;
end;
In the insert mode its working fine(unless you gurus feel to change to make it more perfect.
When I say enter-query and put 'IAS' in the s_type field and then do a execute query it brings all the records of 'IAS'.
Now as I want to update the records, and when I navigate across field(s_type,cer_dl,Seq,xyz) using tab and move the cursor down on second
record(IAS N 2 N), what happens is when I navigate to sequence field the cursor jumps to LAST RECORD( IAS Y 3 N ) of LAST field XYZ.
I am putting the sample record
s_type cer_dl seq xyz
IAS N 1 N
IAS N 2 N
IAS N 3 N
IAS N 4 N
IAS Y 1 N
IAS Y 2 N
IAS Y 3 N
The cursor moves to last record --IAS -Y -3-N when I tab across the second record.When I say enter-query and put 'IAS' in the s_type field...For your validation to work you must not allow users to enter records in the middle of a block, clear records from the block or query specific records. If you allow the users to enter a query then you are allowing 2 of the rules to be broken.
-
Web Form Hangs When Scrolling through Multi-Record Block
Hello!
I have a web-deployed form that uses the Sun Java JVM and utilizes WebUtil.
We are using JDK v1.4.2.
When I open this form using the Java plug-in and try to scroll through a multi-record block ... it will hang at various points and eventually I have to close the form because it won't respond.
This does not happen if I simply access the form through the Microsoft JVM.
Any suggestions?That's a know solved bug. You must install AS10g patchset 9.0.4.2.
For me it solved the problem.
Bug 3557904: Forms hangs (deadlocks) when scrolling on XP under some circumstances
Joao Oliveira -
Copy the Last Record queried to the new record in a Multi - Record Block
Hi Team
When i enter a new record in a Multi - Record Block the last record should get copied to the new record.
Please help me.
ThanksHi
pls use...
DUPLICATE_RECORD;Amatu Allah -
How to call a report with a bind variable from a multi-record block
Hi,
I have created a report using the BI Publisher functionality. I did all the integration, created the SQL Query and uploaded the template. Up till here everythings fine!
My SQL Query has 2 bind variables.
I will call my report from a multi record block, at the end of each record an icon is shown which the user can click to open the report.
I created a column link for this item (PRINT_REPORT=Inschrijvingsformulier) but I do not manage to pass the parameters to my report. The parameters I want to pass are 2 columns in this Multi Record block.
I created 2 hidden fields on the page P9_PARAMETER1, P9_PARAMETER2 with the same names as my bind variables and fill this in with the values #PARAMETER1#, #PARAMETER2# from the multi record block.
It seems it does not work as my report stays empty. (also XML file stays empty).
Am I trying the wrong way?
Thanks for any advice,
Krishi khadeer,
create one report program and write the required code,and call this function module 'SSF_FUNCTION_MODULE_NAME' and give your smartform name and also when u activate ur smart form u will get one function module call that function module also and specify any tables used...
i think this solves ur problem...
any queries revert back..
pls reward points if helpful,
shylaja -
Setting background color in multi record block
Hi all!
I've a table with around 150 records of colors with html-color-names and rgb codes.
I would like to have a sample item in my form 9.0.4 to display the color as a preview for
each record in a multi-record block when querying the table.
I would not like to create a visual attribute for each color. So display_item() is no choice.
(except: somebody show me how to create va's with the japi)
Somebody knows a way to accomplish this?
Thanks in advance and regards
StauderHere's a solution which should work :
1. Use a mirror item for the numeric item which has to
be displayed
using the format mask based on value in column1
The data type of the mirror item : Char
X and Y co-ordinates : Same as the item
on which it is
mirrored
Size and Height : Same as the item
on which it is
mirrored
2. On normal display, Mirror item is displayed
3. When Mouse-Click or Pre-Text Item trigger on the
Mirror Item :
- Use the Go_Item ('Actual Numeric Item');
This will bring up the Numeric Item and the Mirror
item goes in hiding
- A VWI trigger on Numeric Item should Then be :
If ( :col1 = 'A' ) Then
:Mirror_Item :=
To_char(:NumericItem, ',999,999.99');
Else
:Mirror_Item :=
To_char(:NumericItem, '99999999');
End If;
4. A key-Next-Item (On Numeric Item) or other trigger ??
should then
use Go_Item (:Mirror Item) to bring forward the
formatted numeric item
-- Shailender Mehta -- -
Check duplicate data entry in multi record block,which is a mandatory field
Dear all,
I have a situation where i have to check duplicate data entry(on a particular field,which is a mandatory field,i.e. it cannot be skipped by user without entering value) while data key-in in a Multi Record block.
As for reference I have used a logic,such as
1>In a When-Validate-Record trigger of that block I am assigning the value of that current item in Table type variable(collection type)
as this trigger fire every time as soon as i leave that record,so its assigning the value of that current time.And this process continues
then
2>In a When-Validate-Item trigger of that corresponding item(i.e. the trigger is at item level) has been written,where it compares the value of that current item and the value stored in Table type variable(collection type) of When-Validate-Record trigger.If the current item value is matched with any value stored in Table type variable I am showing a message of ('Duplicate Record') following by raise_form_trigger failure
This code is working fine for checking duplicate value of that multi record field
The problem is that,if user enter the value in that field,and then goes to next field,enter value to that field and then press 'Enter Query 'icon,the bolth Validate trigger fires.As result first when-validate record fires,which stores that value,and then when-validate-item fires,as a result it shows duplicate record message
Please give me a meaningful logic or code for solving this problem
Any other logic to solve this problem is also welcome@Ammad Ahmed
first of all thanks .your logic worked,but still i have some little bit of problem,
now the requirement is a master detail form where both master and detail is multirecord ,where detail cannot have duplicate record,
such as..........
MASTER:--
A code
A1
A2
DETAIL:--
D code
d1
d2 <-valid as for master A1 , detail d1 ,d2 are not duplicate
d2 <--invalid as as for master A1 , detail d2 ,d2 are duplicate
validation rule: A Code –D Code combination is unique. The system will stop users from entering duplicate D Code for a A Code. Appropriate error message will be displayed.*
actually i am facing a typical problem,the same logic i have been applied in detail section ,its working fine when i am inserting new records.problem starts when i query,after query in ' a ' field say 2 records (i.e. which has been earlier saved) has been pasted,now if i insert a new record with the value exactly same with the already present value in the screen(i.e. value populated after query) its not showing duplicate.................could u tell me the reason?and help me out...............its urgent plzzzzzzzzz
Edited by: sushovan on Nov 22, 2010 4:34 AM
Edited by: sushovan on Nov 22, 2010 4:36 AM
Edited by: sushovan on Nov 22, 2010 8:58 AM -
FETCHING VALUES IN MULTI RECORD BLOCK FROM ANOTHER TABLE USING SELECT STATEMENT.
Hi,
I have one multi record block in which i want to fetch values
(more then one record) from another table using select statement
IN KEY NEXT ITEM.I am getting following error.
ORA-01422: exact fetch returns more than requested number of rows
Thanks in advance.In your case I see no reason to use non-database block and to try to populate it from a trigger with a query, instead of using the default forms functionality where you can associate the block and the fields with table, create where clause using bind variables and simply use execute_query() build-in to populate the block. The power of the forms is to use their build-in functionality to interact with the database.
Also, you can base your block on a query, not on a table and you dynamically change this query using set_block_property() build-in. You can use any dynamic queries (based on different data sources) and you simply need to control the column's data type, the number of the columns and their aliases. Something like creating inline views as a block data source.
However, you can replace the explicit cursor with implicit one like
go_block('non_db_block_name');
first_record();
FOR v_tab IN (SELECT *
FROM tab
WHERE col_name = :variable)
LOOP
:non_db_block_name.field1 := v_tab.col1;
:non_db_block_name.field2 := v_tab.col2;
next_record();
END LOOP; -
Check Duplicate data during data key-in Multi Record Block
Dear all,
I have a situation where i have to check duplicate data entry(on a particular field,which is a mandatory field,i.e. it cannot be skipped by user without entering value) while data key-in in a Multi Record block.
As for reference I have used a logic,such as
1>In a When-Validate-Record trigger of that block I am assigning the value of that current item in Table type variable(collection type)
as this trigger fire every time as soon as i leave that record,so its assigning the value of that current time.And this process continues
then
2>In a When-Validate-Item trigger of that corresponding item(i.e. the trigger is at item level) has been written,where it compares the value of that current item and the value stored in Table type variable(collection type) of When-Validate-Record trigger.If the current item value is matched with any value stored in Table type variable I am showing a message of ('Duplicate Record') following by raise_form_trigger failure
This code is working fine for checking duplicate value of that multi record field
The problem here is that suppose if usee gets a message of ('Duplicate Record') and after that without saving the values if user try to query of that block then also when validate item fired where as I am expecting ORACLE default alert message('Do You want to save?'),I want to restrict this When-Validate Item fire during query time..........................while user try to query.
Please give me a meaningful logic or code for solving this problem
Any other logic to solve this problem is also welcomeWhen-Validate-Record trigger
When-Validate-Item triggerThat smells like Oracle Forms...
And the Oracle Forms forum is over here: Forms -
Image item in multi-record block - PLEASE SOMEONE HELP !
Hello everyone.
I have a multi-record block with an image item that is not in teh table, is populated in the post-query trigger with a read_image_item, from a gif file. This block is child of another block. The problem is that the first records of the block, the ones that fit on the screen, are not showing the image properly, the image appears grey, distorted. In reality, the image dont adjust to the size of the item, as it is especified in the properties. When i scroll down, the rest of records show the image perfect, but this ones still are distorted.
Forms is 6.0.8.22.1, over oracle 9i. Thank you all in advance.hello
just me what is datatype of ur image record ?
Maybe you are looking for
-
Hi, I currently have a 2008 Mac Pro 2 x 2.8 Quad Core Intel Xeon that I am thinking of upgrading. My questions are as follows. Which set up would be best for photography based work, mainly Photoshops CS6 and Lightroom 4 I use a Drobo as my main worki
-
How can i send a Sapscript as an PDF through NACE
Hi experts, I have an requirement that i have to send a Invoice sapscript output in pdf format on mail with Transaction NACE. How can it be done? Regards
-
** Who Copied Who's Design **
If you have a keen eye and examine closely, they are almost 99% identical, except in the ares of its physical dimensions, built quality and colors which I cannot verify now because I own neither of each. Currently, Creative and Valore is selling thei
-
How do i turn my iphone back on after the latest update?
I just updated my IPhone 4 to its latest version. I am not sure what the numbers are cause I forgot, but my phone hasn't been able to turn on for almost 3 days now. When I press the power button the Apple logo pops up and then the cord charger pops u
-
(2014) Creative Cloud Desktop App updates
I noticed in the recent Creative Cloud desktop apps the updates indicate in (2014). Are these apps actually different than the old CC apps for Photoshop, InDesign and Illustrator or once the update takes place the old update for the app without (201