Setting item "database property" properties at pre-query trigger ?
Hi all,
I have a "from clause query" form and try to execute according
to some field value that correspond to different queries.
but my problem is ;
to run from clause query form, all items should be Database item at the same block.
So how can I set some item database properties to yes/No
Is there any build in to achieve this?
Thanks in advance.
Regards,
Defne
Hi all,
I have a "from clause query" form and try to execute according
to some field value that correspond to different queries.
but my problem is ;
to run from clause query form, all items should be Database item at the same block.
So how can I set some item database properties to yes/No
Is there any build in to achieve this?
Thanks in advance.
Regards,
Defne
Similar Messages
-
In one of our form ( we generated this from Oracle Designer), we put the Pre-Query trigger to the first block of the form, where we override the default_where so that it includes something liek this
INSTR (cpb_order_title, 'housing', 1, 1) > 0 AND INSTR (cpb_order_title, 'review', 1, 1 )> 0
But when during execution, we found that alongwith the above filter, it also appends the regular default_where to the above condition. Something like this
INSTR (cpb_order_title, 'housing', 1, 1) > 0 AND INSTR (cpb_order_title, 'review', 1, 1 )> 0
AND ( UPPER (cpb.cpb_order_title) LIKE :1
AND (cpb.cpb_order_title LIKE :2 OR cpb.cpb_order_title LIKE :3)
Could not find how it is adding the default condition. Any help would be very much appreciated.
Thanks
DebDebra,
So, this is the default WHERE clause on the block?
AND ( UPPER (cpb.cpb_order_title) LIKE :1AND (cpb.cpb_order_title LIKE :2 OR cpb.cpb_order_title LIKE :3)>
I don't see anything in your code that would cause the new where clause to be appended to the original where clause, unless you have code somewhere else that automatically sets the default where clause programatically.
The fact that your code sample sets the block where clause to an empty string ( '' ) if the order_title is NULL makes me wonder why you have a DEFAULT_WHERE defined in the first place. Not to mention the fact that the first thing your Pre-Query trigger does is set the DEFAULT_WHERE to an empty string as well. My first suggestion is to simply eliminate the WHERE property default value.
What is the output of your call to "MESSAGE_POPUP?" Is the original WHERE clause listed in the resulting Alert? Have you displayed the contents of the vQuery variable before the DEFAULT_WHERE assignment and if so what it the output?
Craig... -
Pre-query trigger firing twice
I have a pre-query trigger on a block in a form to set the "default where" as
SET_BLOCK_PROPERTY (BLOCK_ID, default_where,where_clause);
but when I look at the current query for the session the where clause looks like
WHERE screening_group_num = :1 AND (screening_group_num = :2)
Why is this firing twice?
I checked this thread : Re: pre-query firing twice but I dont have any calls to execute_query in the form.I am setting the where_clause in the pre_query trigger for that block.
and the copy value is not set for the screening_group_num item or for that matter any other item in the block. For all other items, it dosent really matter if the comparison is done twice (as the values will be same) , but when I have text (string) items, then its a problem. For example:
Where
(event_description LIKE '%test%') --- this is from the pre_query trigger where I am doing a string_comparison using 'Like and %%'
AND (event_description = :1) --i suppose this is from the default where clause of the block -
Hi,
I have a datablock in the form that is based on a DB table. There are few queriable fields in the block including begin and end dates. If i dont use any pre-query trigger, the records are queried fine. But I want to do a range selection between begin and end_Date fields. Therefore I created a pre-query trigger and set a new_where_clause with all my query_fields and set that as defualt where for my DB block.
SET_BLOCK_PROPERTY (block_id,default_where, where_clause);
But when I see the query in toad session , the query looks like
WHERE (field_1 = :1) and field_1 = :1
that means its running the defualt where clause on the block and the new_where clause at the same time.
I checked the form and I dont have any calls to execute query....
what can be the problem?1. What is your new_where_clause? (example, please)It's hard to read. Use the \{code\} tag.
FUNCTION get_comparison_phrase (database_column_name VARCHAR2,
relational_operator VARCHAR2,
selection_field_name VARCHAR2)
RETURN VARCHAR2 IS
BEGIN
RETURN CASE
WHEN NAME_IN (selection_field_name) IS NOT NULL THEN
' AND '
|| database_column_name
|| relational_operator
|| ' :'
|| selection_field_name
ELSE
NULL
END;
END get_comparison_phrase;
where_clause := 'WHERE (1=1)';
if NAME_IN (selection_field_name) IS NOT NULL THEN ' AND '
|| database_column_name
|| relational_operator
|| ' :'
|| selection_field_name
ELSE
NULL
END;
where_clause :=
where_clause
|| get_comparison_phrase (
'screening_group_num',
'=',
'EXCEPTIONAL_EVENTS.screening_group_num'
WHERE (field_1 = :1) and field_1 = :1I do not see 'WHERE (1=1)'; there.
Edited by: Michael Roy on Oct 21, 2009 9:47 AM -
Join with another table in pre-query
Hi,
We have a large data block and we need to order some columns based on street name for example, not id. The base table of db block contains an id_street column, and 'streets' table contains id and name.
Ok, in pre-query trigger of that block, we have a complex logic and we dynamically build the where clause. At the end, we set the order_By clause of the block, to order the rows, for example we need to order by the 'my_date' column asc (it's a date type column), and street desc; but street NAME, not id. We don't want to use a from clause query, because the dynamically where clause logic it's complex.
How can we join the db block table with 'streets' table in pre-query, so when constructing the order by clause to specify something like
set_block_property('ADRESE_NEZONATE', order_by, 'my_date, name desc');where 'name' is the name of the street, from the 'streets' table.
Is it possible in pre-query, somehow? Or, in my case where can I join with that table and use that column in pre-query at setting order by?
Thanks!
Edited by: Roger25 on 26.04.2013 12:31I understand what you say but partially.. please explain in more detail how to do that;
How should look the adrese_nezonate block, then? I have to add a 'name' column and set copy value from item property to 'STREETS.NAME', and database_property No?
Then the post-query trigger how should look like (the order by clause)? The post-query sends the entire query (with where/order by clauses) to the server, but in that "select... where... order by" (built dynamically) there are only columns from that block (adrese_nezonate). I need to join with streets, INSIDE that query.
Thanks. -
Forms 10g : How to set the Database Item property for an item dynamically ?
Hello all,
I have a requirement where I need to set the database item property of an item to TRUE/FALSE
dynamically at runtime based on certain conditions.
Earlier, in forms 6i I've used,
Set_Item_Property (<item_name>, DATABASE_ITEM, PROPERTY_TRUE);
But in Forms 10g it doesn't recognize this Database_Item property and gives a compilation error.
Have I overlooked something or has this property become obsolete in Forms 10g ?
If obsoleted what is the replacement property ?
Regards,
SamSome options:
1. Create a database-view, including the "real" column in databases where it exists and a "dummy"-column in databases where it doesn't exist.
If that's not possible,
2. set database="No" for your item and
-- create a POST-QUERY-trigger which reads the data for that column from the database, if the column exists, and
-- create a ON-UPDATE-trigger which includes an
UPDATE_RECORD;
UPDATE THETABLE SET
THECOLUMN=thevalue
WHERE ROWID=:THEBLOCK.ROWID;3. Base your block on either a select-from-clause, a ref-cursor or a procedure to adjust he query-part,, for saving use a procedure. -
Set item property to false and true
when i set item to false and then set item property to true. The item is displayed but its gray out and not enabled. Am i missing something
Set_Item_Property('PUSH_BUTTON_SAVE',VISIBLE,PROPERTY_FALSE);
and then
Set_Item_Property('PUSH_BUTTON_SAVE',VISIBLE,PROPERTY_TRUE);Check the Forms online help on Set_Item_Property, near the bottom in the usage notes. Lots of things happen when you set visible to False:
Setting DISPLAYED to False:
sets the Enabled and Navigable item properties to False
sets the Updateable item property to False
sets the Update_Null item property to False
sets the Required item property to False
sets the Queryable item property to False
So you may need to set more of them back to true in your code when you want to make it re-display. -
Setting required property on pre-update trigger
i have set required property of 3 items on pre-update trigger of a block such that if user updates a listbox and if the updated value is 'P' for perentage then the user must fill all the 3 fields but even after setting the required property the record is saved if the fields are empty. the trigger is firing & everything looks ok. the portion of code i've used is:
BEGIN
IF :ROUTING_ENGINE_RULES.DISTRIBUTION_TYPE = 'P' THEN
PAUSE; /*TO CHECK ENTRY ON TRIGGER*/
SET_ITEM_PROPERTY('carrier_cd_percent1',UPDATE_ALLOWED,PROPERTY_true);
('carrier_cd3_percent',UPDATE_ALLOWED,PROPERTY_true);
I'VE SET OTHER 2 FIELDS SIMILARLY
put your code in when-listvalue-changed trigger for that 'P' trigger.
to put it in existng place is still too late. -
Query to set item default value
I'm trying to set a default value of an item by using a query. The first thing I tried is setting the source value to be:
select 'TRDM-R-'||LPAD((MAX(SUBSTR(EXPAND_REQ_ID,8,3))+1),3,'0') EXPAND_REQ_ID FROM BANKSRG.TRDM_REQUIREMENTS;
with item display type as Text, source type SQL Query. This displayed the value in the form, but did not save to the DB. (I tried all the other display types for text too)
The next thing I tried (a suggestion for someone else in the forum) was set item display type is Display as Text (based on PL/SQL, does not save state), and the source type is PL/SQL Anonymous Block, with this query:
for c1 in
(select LPAD((MAX(SUBSTR(EXPAND_REQ_ID,8,3))+1),3,'0') EXPAND_REQ_ID
FROM BANKSRG.TRDM_REQUIREMENTS)
LOOP
htp.p('TRDM-R-'||C1.EXPAND_REQ_ID);
EXIT;
END LOOP;
but I get this error: Error ERR-9132 Error in PLSQL expression for item default code, item=P2_EXPAND_REQ_ID
Then I tried the above query in the Default Value section, with the same error.
I've also tried adding computations, but if i get the value to display, it still won't save to the DB.
I would greatly appreciate any suggestions!
RobinIn case anyone else is new to HTMLDB and needs the answer to this question, I finally figured it out.
In the Item the Display is Text Field, Source Used is Always..., Source Type Database Column, Source Value EXPAND_REQ_ID, Default Value &P2_EXPAND_REQ_ID., Default Value Type is Static Text...
Then I created a Before Region computation, type sql Query, entered my query in the computation,
select Condition Type Value of Item in Expression 1 is NULL, Expression 1 is P2_EXPAND_REQ_ID.
Not so difficult, it just took a lot of time to try all the options. -
Hi
I have a document set with properties Type, name , modified and modified by . I want to include additional properties in document set content items .Is there a way to change the properties , or hide some properties from document
set .How do i do that?
ex
i e add more properties in document set contents as it inherits from document set
Thanks in advance
nain1987Click Library settings on the ribbon, and within that click the Document Set Content Type.
The next page you'll see has an option called Document Set Settings.
Here you can specify properties for the document set itself, plus which are inherited by the items in the document set.
If you want items to have properties independent of the document set, add those in the library settings page.
If you want to change what is displayed, change the Views for the library or those views used by the document set.
w: http://www.the-north.com/sharepoint | t: @JMcAllisterCH | YouTube: http://www.youtube.com/user/JamieMcAllisterMVP -
Error : FRM-41316: cannot set insert allowed property of disabled item
Hi Forum,
I have a requirement to making the following field non editable Ship Confirm Rule+ in Order Management-->"Release Sales Orders"-->"Shipping" tab
I tried to achieve this using form personalization using the below condition and action
Trigger Event - WHEN-NEW-ITEM-INSTANCE
Trigger Object - RELEASE.DOC_NAME
Condition - :RELEASE.PICKING_RULE is not NULL
Processing Mode - Both
Action Type - Property
Object Type - Item
Target Object - RELEASE.SHIPCONFIRM_RULE_NAME
Property Name - ENABLED
Value - FALSE
I could see the field becomes non editable but when i navigate to "Release Sales Orders"-->"Shipping" tab and press tab button on the field "Trip" I am getting the below error
FRM-41316: cannot set insert allowed property of disabled item RELEASE.SHIPCONFIRM_RULE_NAME
Even i have tried with the following Property Names set to " FALSE " but still the field is able to editable
ENTERABLE
ENTERABLE(APPLICATIONS COVER)
INSERT_ALLOWED
INSERT_ALLOWED(ITEM-INSTANCE)
UPDATE_ALLOWED
UPDATE_ALLOWED(ITEM-INSTANCE)
Please help me to resolve this issue.
Thanks in advance
Regards,
CSKHi Francoiq,
Thanks, As you advised I will post this in E-Business Suite
Regards,
CSK -
FRM-41316: cannot set insert allowed property of disabled item
We are facing an error message while entering the Invoices in Apps R12 . Requested to please look into the issue.
Navigation : CNG India Local AP Super User
Oracle Payables>Invoice >Entry>Invoice
getting the error
FRM-41316: cannot set insert Allowed Property of disabled item inv_sum_folder.doc_category_name
thanks in advance....Please see these docs.
12.1.1 – FRM-41316 Error On Invoice Workbench Forms [ID 862433.1]
R12: Invoice Workbench, get FRM-41316 Error Message [ID 1332977.1]
FRM-41316 Cannot Set Insert Allowed Property Of Disabled Item LINE_SUM_FOLDER [ID 467206.1]
FRM-41316: FRM-41316: Cannot set Insert Allowed property of disabled item APP_FOLDER.TRANS_TO_RECEIPT_RATE When Applying To Foreign Currency Invoices [ID 392368.1]
Thanks,
Hussein -
POST-QUERY trigger cannot retrieve the database field in TEMPLATE.fmb
I have tried to create a form using TEMPLATE.fmb in Oracle Apps R11i. I found that the POST-QUERY trigger cannot retrieve the database field (which is display item property) properly. Can anyone tell me how to retrieve the displayed database fields? Thanks for any helps.
POST-QUERY would fire after the query has been executed, it does not do the actual data retrieve.
See if the items you have put have the data source properties set and are not control items.
btw, this forum is for OA users, you would get better response to your query if you post it in forms forum
Thanks,
Tapash -
Using Set Break Order property
Hi,
I create a Break Group with one column in the Data Model
Open the Property Palette for the column and the Set Break Order property does not appear. However the Break Order property does appear and its values is asending or descending.
Here's the definition for this property in Report Bulder Help "The Set Break Order Property is whether to set the order in which to display the column's values, using the Break Order property". This implies that if the Break Order property is set to something other than NONE, the Set Break Order is Yes.
Another reference I have states " A point to be noted is that all break groups must have at least one column with the Set Break Order set to the Yes value".
My concern/question is in all of the documentation I have read both properties appear, but only one appears in my environment. Am I doing something wrong? Is there a setting to be change to make both properties appear? I am using Reports 6i, on Win2000 and connected to an Oracle 8i database.
Thanks in advance,
AudreyHi,
This looks to be a documentation mistake. From Reports 3.0.5 onwards, We have removed the Set Break Order Property for columns and just added
a "None" item to the Break Order property poplist instead. For columns which cannot be break columns, we do not even give the option of changing the Break Order from None to anything else. So just go-on desiging your Report with just one break order property, that is sufficient.
Thanks,
Rohit -
Problem with setting item instances on a tabuler form
I have a tabular form (6i) with a control block that displays 10 (non-database) records at a time. In cases where less than 10 records are displayed, I want to (programmatically) prevent the user from entering any values in the unpopulated text item instances but still be able to enter values in the populated instances. Anyone have any ideas?
Thanks,
JeffFriends--
Below is some updated code. I initially have set the insert_allowed property at the block and item level to "NO" in the property palette for the text items in this block. The number of records displayed is set to 10. The below code runs fine and populates the tabular items in the block and changes the visual attribute in the populated items to blue as designed. However, the insert_allowed is not changed for the populated item instances-- or even the unpopulated item instances for that matter. I set the insert_allowed property to "NO" at the block and item levels initially so that if the cursor populates fewer than 10 rows in the instances, the remaining unpopulated instances will not be insertable-- only the populated ones will be insertable. I am nearly at my wits end with this...ha ha. Let me know what you all think.
DECLARE
v_col varchar2(255);
v_owner varchar2(255);
v_schema varchar2(255) := :ctl2.v_owner;
v_table varchar2(255) := :ctl2.v_table_name;
v_val varchar2(1) default 0;
x int;
cur_itm VARCHAR2(80);
cur_block VARCHAR2(80) := :System.Cursor_Block;
Cursor matrix_cursor IS
Select column_name
From all_tab_columns
Where owner = upper(v_schema) and
table_name = upper(v_table);
BEGIN
FIRST_RECORD;
go_block('ctl');
clear_block;
OPEN matrix_cursor;
LOOP
FETCH matrix_cursor into v_col;
EXIT when matrix_cursor%notfound;
BEGIN /* loops thorugh the items in the block instance changing the visual attribute and insert_allowed properties... */
cur_itm := Get_Block_Property( cur_block, FIRST_ITEM );
WHILE ( cur_itm IS NOT NULL ) LOOP
cur_itm := cur_block||'.'||cur_itm;
Set_Item_Instance_Property( cur_itm, CURRENT_RECORD,
VISUAL_ATTRIBUTE,'visual_blue');
set_block_property('ctl', insert_allowed, property_true);
set_item_instance_property(cur_itm, current_record,
insert_allowed, property_true);
cur_itm := Get_Item_Property( cur_itm, NEXTITEM );
END LOOP; -- ends inner loop
END;
-- populates the fields for each record...
:ctl.v_field_name := v_col;
:ctl.v_pos_01 := v_val;
:ctl.v_pos_02 := v_val;
NEXT_RECORD;
END LOOP; -- ends outer loop
CLOSE matrix_cursor;
first_record;
End;
Maybe you are looking for
-
In return order price should copy from the invoice
Dear All, Greetings for the day, We are facing with the below issue, please help to resolve the issue. We have one discount condition type; scales have been maintained for that condition type. The scales are like below Up to 10,000 liters - 0% Above
-
Podcast accepted by iTunes, but not showing on search results after days
I submitted a podcast to iTunes about a week ago and on the 20th I received an e-mail to say that it had been accepted onto iTunes. Several days later, however, and it still won't show up on search results. When I search for the title of the podcast,
-
SOAP - RFC possible with Direct Connection?
On our PI 7.1 system we have a RFC which we want to expose as a webservice with all the standard monitoring SAP PI provides. On PI 7.0 is used to create a configuration scenario in Integration Builder and generate a WSDL. I have read the document 'Co
-
MDS9509 to MDS9710 Migration Utility/tools/best practise tips required
Dear Champs, Trust everyone doing good. I have a 2xMDS9509 from primary and 2xMDS9509 from DR which are connected with IBM, Netapp, Oracle and EMC Storages. We have more than 250 connections per switches. We are in the phase of migrating these switch
-
ORACLE8I - LONG TYPE을 LOB TYPE으로 CONVERSION하는 방법(TO_LOB)
제품 : ORACLE SERVER 작성날짜 : 2002-04-12 ORACLE8I - LONG TYPE을 LOB TYPE으로 CONVERSION하는 방법(TO_LOB) =============================================================== Purpose Long type의 data를 lob type으로 conversion하는 to_lob function에 대해 알아보자. Explanation Oracl