ADF 'calculated' non-database field
I need some help with this
In a VO (lets say VO1(Cod.....Judet) i have a transient attribute Judet,
then i have VO2 :
select decode(l.cod_parinte,
null,
l.denumire_d,
l.cod,
l.denumire_d,
l.denumire_d || ' (' || lp.denumire_d || ')') denumire_d,
l.COD_JUDET,
l.cod
from localitati l, localitati lp
where l.cod = :CodLocalitate
and l.cod_parinte = lp.cod(+)Now I wan that Judet to be populated based on the result of of querying VO2 with the VO2.CodLocalitate = VO1.Cod
Till now i had declared a view accessor on VO1 for VO2 and put a LOV on Judet (View Att.=Judet ; List Att=CodJudet) and the UI to show me the denumire_d field
The problem is that when i try the view object in OBCB i have a empty field(although if i run the appropriate query i have a value)
I did a workaround ... putting the query(adapted properly) of VO2 into the expression of Judet att and it works like this... anyway i don't like this approach...
So what have i done wrong in the first place?
Edited by: kquizak on Nov 7, 2008 4:40 PM
It seams that the workaround does not work ... my Judet field does not refreshes after an update
i need to acheive this querry in adf
select count(*) into var_count
from appl_journals
where aj_bu=:global.bu and
aj_year=:FIN_PERIODS.fp_year and
AJ_PLANT =:FIN_PERIODS.FP_PLNT AND
aj_period=:FIN_PERIODS.fp_period and
aj_appl=:AJ_APPL and
aj_status='N' ;
if var_count<>0 and :AJ_APPL is not null then
:APPLICATIONS.appl_exist:='Yes';
elsif :AJ_APPL is not null then
:APPLICATIONS.appl_exist:='No';
end if;
how can i perform this
Similar Messages
-
Hi.,
i am using jdev 11.1.5
i need to insert a non database field in jspx page
i had created a table finperiod
i need to insert a four nondatabse fields named as rec,dist,supl,cust.
How can i acheive this?i need to acheive this querry in adf
select count(*) into var_count
from appl_journals
where aj_bu=:global.bu and
aj_year=:FIN_PERIODS.fp_year and
AJ_PLANT =:FIN_PERIODS.FP_PLNT AND
aj_period=:FIN_PERIODS.fp_period and
aj_appl=:AJ_APPL and
aj_status='N' ;
if var_count<>0 and :AJ_APPL is not null then
:APPLICATIONS.appl_exist:='Yes';
elsif :AJ_APPL is not null then
:APPLICATIONS.appl_exist:='No';
end if;
how can i perform this -
Problems with query on a non-database field
Hi,
Hopefully I am in the correct section...
I have some problems. I wanna query a non-database field but it does not work for one of them. I have tried the following...
declare
vsNewDefaultWhere varchar2(4000);
vbFirstWhere boolean;
cursor curArea is
select a1_area, a1_hbno, a1_seqno
from b1_in, c1_hdr, a1_bl
where b1_sequenceno = a1_seqno
and b1_shipid = a1_hbno
and b1_id = :c1_shipid;
rowArea curArea%ROWTYPE;
procedure mergeStrings (sNewWhereClause varchar2) is
begin
if not vbFirstWhere then
vsNewDefaultWhere := vsNewDefaultWhere || ' and ';
end if;
vsNewDefaultWhere := vsNewDefaultWhere || sNewWhereClause;
vbFirstWhere := false;
end mergeStrings;
begin
navigate.resetselrows('IMP_HDR');
navigate.resetselrows('IMP_DTL');
if not navigate.customwhereclause then
navigate.resetwhereclause('IMP_HDR');
end if;
vsNewDefaultWhere := Get_Block_Property('IMP_HDR', DEFAULT_WHERE);
vbFirstWhere := vsNewDefaultWhere is null;
---- does work!
if :IMP_HDR.c1_usecode is not null then
mergeStrings('c1_shipid in (select b1_id from b1_in where b1_fac = ''' || :global.fac || ''' and b1_comp = ''' || :global.comp || ''' and b1_code like ''' || :c1_usecode || ''')');
end if;
---- does not work!
open curArea;
fetch curArea into rowArea;
if curArea%found then
if :IMP_HDR.c1_area is not null then
mergeStrings('c1_shipid in (select b1_id from b1_in, c1_hdr, a1_bl where b1_fac = ''' || :global.fac || ''' and b1_comp = ''' || :global.comp || ''' and b1_sequenceno = ''' || rowArea.a1_seqno || ''' and b1_shipid = ''' || rowArea.a1_hbno || ''' and rowArea.a1_area like ''' || :c1_area || ''')');
end if;
end if;
end;
Thanks for your help in advance and let me know if you Need more Information.Hello,
Ask Personalization questions in the dedicated E-Business Suite forum ;-)
Francois -
How do I get a value from a portal form for a non database field ? HELP!!
I have a form based off of a table that I added a field to. The form is to allow the user to change abbreviation for a
department field ie. BIO to BIOL. for a biology department. I have a pl/sql procedure for validation using the custom option
on the update button to verify the user and update the data. I have tested to code at the sql prompt and it works.
They only difference between the prompt and the form is the non-database field new_dept_abbr was added to the
form. I don't know how to capture the value of the user input into a variable that can be used in the pl/sql.
Any help would be appreciated.
I have tried this approach
v_new_dept_abbr := p_session.get_value_as_varchar2(
p_block_name => 'default',
p_attribute_name => 'new_dept_abbr'
have tried using p_attribute_name as 'a_new_dept_abbr' but this does work and does not exist in the body of the form.
Have also tried setting the p_block_name to _session - still doesn't work.
Any ideas??
Thanks
Debbie BrennanThanks for the info. I tried that and it still doesn't pull the value. I have opened a TAR via metalink, but I'm not getting any
satisfactory answers. I ran across an note - 137172.1 that has this snippet of information in it.
Unfortunately, at this time (portal 3.0.7.6.2) , a non-table item cannot be
referenced in a plsql event handler, only in client side JavaScript code. This
is a known limitation and will be fixed in a future release.
I don't know how to get the value from the client side JavaScript code to a pl/sql variable. Do you?
I've been trying to get them to tell me if the 'known issue' has been addressed in 3.0.9.
I'll keep at it. Thanks so much for your suggestion I appreciate it.
Deb -
Insert Image to table from a Non Database Field
Hallo,
db- 9i EE R2
forms - 6i R2
OS - W2003
I have a requirement to upload Images to the database from forms.
I planned to keep the transaction data and the Images separately in different tables with a reference.
So, I created the Image field (BLOB) with a Non Database Field in the Form and use a button to upload the Image. (using READ_IMAGE_FILE).
I tried to insert the Image to the Actual Image table in PRE-INSERT Trigger at block level.
But I was not able to Insert the using reference method. (Cannot compile the PRE-INSERT)
INSERT INTO IMAGE_TB (ID,IMAGE)
VALUES (IMAGE_SEQ.NEXTVAL, :ITINERARY_MAP.IMAGE);
So, Please help me to insert a image to different table from a Non Database Field?
ThanksI don't think it will work with a non-db-item. But you could create a separate block based on your image_tb-table, use read_image_file on the then db-based-column and then simpy issue a commit_form.
-
How to display records from a query into non-database field
Hi
I a have a problem:
I have a query with many tables and 6 column(select a,b,c,d,e,f from x,y,z,t,s,g where conditions) and I use 3 parameters.
I create 3 parameters :datai,:dataf and :partener and a button with a trigger when button is pressed.
Then a create a manualy block with six field non-database a1,b1,c1,d1,e1,f1.
Now I want to display all the records from my query into a1,b1,c1,d1,e1,f1 where a1=a,b1=b,etc. and all the records (if I have 20 record, it will display 20 records in non-database field) when I press the button.
How I made:
I create a cursor with query then
begin open cursor
loop
fetch cursor into :a1,:b1,:c1,:d1,:e1,:f1;
end loop;
close cursor;
end;
It display one record in a1,b1,c1 only and it have to display 100 records and are date for all the fields.
Can somebody help me in this problem?
Thanks.
Edited by: 928437 on Oct 1, 2012 2:55 AMCreating a view, and querying that into a database block is an excellent solution.
To use the non-database block:
You're missing the all-important Next_Record; command.
<pre> Begin
Go_block('X'); -- block X is the non-database block
Clear_Block(No_Validate);
open cursor X1;
loop
If :System.Record_status != 'NEW' then
Next_Record;
End if;
fetch X1 into :a1,:b1,:c1,:d1,:e1,:f1;
Exit when X1%NOTFOUND;
end loop;
close X1;
end;</pre> -
Passing url parameter values to a non database field
Hi,
How do I pass values from the url to a non database field ?
The following works for a database field:
http://host:7777/pls/portal/PORTAL.wwa_app_module.link?p_arg_names=_moduleid&p_arg_values=1892460035&p_arg_names=_show_header&p_arg_values=YES&p_arg_names=deptno&p_arg_values=20
but if I use the same for a non database field item20 it doesn't do anything.
http://host:7777/pls/portal/PORTAL.wwa_app_module.link?p_arg_names=_moduleid&p_arg_values=1892460035&p_arg_names=_show_header&p_arg_values=YES&p_arg_names=item20&p_arg_values=2003
Thanks,
Sonal.Hi,
Are you trying to query on this field? It wont work because only database fields can be queried on.
Thanks,
Sharmila -
Update of non-database fields mapped to database fields
I have two columns start month and start year which
are non-database columns and which map to one database
field start date in the database.
I have a post-query trigger on the start month and
start year fields to derive the value from the
database field start date when the form is queried.
When I try to update the form, the update does not
work - if I remove the post-query trigger then the
update works but, the month and year non-database
fields do not get queried.
Any help will be greatly appreciated.
Thanks,
Suzannesince those 2 fields are not connected to the database field you need to code the update to the database.
Use the pre-insert trigger and set the value of the date item according to the values of the 2 fields. -
Xml file, non database field etc..
Hi,
There is a requirement for putting a non database field in an
infobus grid control and populating it with some value at the
runtime. As this is not directly available in gridcontrol, many
have tried using a join query as I could see from the
postings.(Like select deptcode,desc from emp, dept where
emp.deptcode = dept.deptcode). This works well when the data is
queried from the database. But when a new deptcode is entered, it
is not possible to get the corrosponding value from the database
and show it on this field, as u get readonly attribute error.
Even if u explicitly change the attribute to updateable the error
will remain as such.
The cause of this problem, I have tracked down to the xml file.
The entity for the updateable table (in this case EMP) does not
have the attribute for deptdesc. If this is manually added, it is
possible to add values to the deptdesc column. The catch is when
inserting a row to the database. All the attributes in the
entity
will appear in the insert statement and u end up with an invalid
column name error for the deptdesc column.
Seeing this consistant behaviour, I assume that the insert
statement is created by parsing the xml file. Had there been an
attribute value in the xml file for insert into database (just
like IsNotNull etc.. perhaps IsUpdateable which can be set
manually), while parsing this attribute can be removed.
To do this I would like to know where this xml parser is
implemented in jdev. Is it possible for me to change its
behaviour or can I expect to get a patch for this? This
functionaliy is very much essential for me, as I am in the middle
of a very large project using jdev2.0. I don't mind implementing
it, if the source is available.
Any helpful suggestions, comments are welcome. Sorry for the long
post and thanks
--Gopal
nullI don't think it will work with a non-db-item. But you could create a separate block based on your image_tb-table, use read_image_file on the then db-based-column and then simpy issue a commit_form.
-
Set the value of a non database field in forms
hai friends ,
Have been struggling a lot with the problem now . Could anyone suggest me how to go about it.
I want to set the value of a field in a form . I know the function set_value and set_value_as_(data type ) does the work . But then is there any constraint on the position where it is called.
My requirement is on querying a form the data from the tables mut be populated( which the portal handles) and I want to populate the non database bound fields with certain values.
Could any one help me out with this ..
nullI need to set value to one of the object attributes if that attribute is blank.This is some kind of a default value that you want, then? If so then just take care of that when you output it. Use <c:if>, and if the attribute is blank then output the default value, otherwise output the attribute.
Or have the servlet that created that request attribute take care of that requirement. -
How to promt user to save changes when changing non-database fields?
Hi,
I have a form with two tabs. The datablock Block_1 on tab_2 is based on a database view. But all the displayed items of Block_1 are non-database items. Whenever a user changes some items in Block_1 and presses save button, the values from non_db items get copied to the db_items (based on view) and commit_form is called. This works fine.
But the problem here is: after changing some items in block_1, if the user navigates to some other option/form from the menu , the form doesnt promt the user to 'save the changes' and all the changes made are lost. How can I fix that?
I have a form level key-exit trigger, (which does not fire) with following code :-
Declare
X Number;
alert_is alert;
Begin
If :System.Mode = 'ENTER-QUERY' Then
Exit_Form;
Else
If :System.Form_Status In ('NEW','QUERY') Then
alert_is := FIND_ALERT('TMPL_EXIT'); -- "Are you sure you want to exit?"
X := Show_Alert('TMPL_EXIT');
If X = Alert_Button1 Then
Exit_Form(no_validate);
End If;
Else
Exit_Form;
End If;
End If;
End;Slava Natapov wrote:
Samita wrote:
Whenever a user changes some items in Block_1 and presses save button, the values from non_db items get copied to the db_items (based on view) and commit_form is called. Try to copy values to the db_items not in save button, but in WHEN-VALIDATE_ITEM of non_db items.- I created the non-db items becoz, it was asking me 'Do you want to save changes', even when I only queried data from the view (becoz i was doing some computations while displaying the items. and the form assumed that the DB items were begin changed ). Inorder to get rid of that problem, i used mirror_items (non-db) for all the db items.
So under this scenario, when i copy values to the db_items in WHEN-VALIDATE_ITEM trigger of non_db items, the form considers the db_items are changed and asks 'Do you want to save changes' even when the user has not made any changes and only queried data.
Edited by: Samita on Dec 9, 2009 10:12 AM -
Sorting on non database fields
Hi,
I have a Master-Detail form ( query only form). The detail block has 10 DB fields and 2 NON DB fields (check boxes) . I have implemented Sorting functionality in such a way that, I have buttons on the top of each field and if the button is pressed on , let us say for Eg. Emp Name, sorting should be done on Emp Name and followed by other fields.
Order by clause after pressing Emp Name looks as follows:
Order by empname, empno, sal,......
But can we implement the sorting functionality for check boxes also ? ( Check boxes are non DB Fields )
These check boxes are populated with cursor in POST-QUERY trigger at block level ( check boxes are in Detail block.)
how to implement soring on these two check boxes?
Cheers
Ram KanalaThanks Every one,
We can have 2 approaches:
1. Since my block is based on the view, i have to change my view, to include
the Non- DB check box values. I can get the check box values using a function.
2. Another approach is , write a SELECT statement to select all the
coumns from the view along with the two NON-DB fields, (using function )
and use this SELECT clause in the QUERY SOURCE property of the block.
Thanks a lot for your help.
Cheers
Ram Kanala -
Show/Hide NON-DB field in a form
Hello, I've been reading all these forums about how to hide or show form fields dynamically. Here's my situation. I have a form that updates to a table Project. By default, once a user submits this form, certain groups will be notified that a new project exists. However, we want certain users (ITSUSERS) to be able to bypass this alert. I have added a checkbox field (SKIPHD) to my form. It does not pull any information from any table. I am planning to program the behavior I want for this checkbox into the doInsert. However, I do not want this option to be visible to any non- ITSUSERS. I am working with this code from another forum member, but I'm thinking it won't work, since this is a non-database field:
declare
cUserid varchar2(30);
cSecrGroup varchar2(30);
iSec number;
begin
cUserid:=portal.wwctx_api.get_user;
cSecrGroup := 'ITSUSERS';
select count(*) into iSec from person_ctl_syn where person_username=cUserid and person_secr_group_code='cSecrGroup';
If iSec = 1 then
htp.p('<SCRIPT LANGUAGE="JavaScript">
function get_index(p_name) {
var x;
for (x=1; x<document.forms[0].length; x++){
if ( document.forms[0].elements[x].name == p_name) {
return x;
var j = get_index("NEW_REQUEST_FORM.DEFAULT.SKIPHD.01");
document.forms[0].elements[j].style.visibility="hidden";
</SCRIPT>');
End If;
end;
This is a really big project I'm working on. I need help!To add to my previous problem, I'd also like (and this might be impossible for a javascript newbie like me) that when one check box is selected, another becomes visible... within the same form. I will have two checkboxes, one is SKIPHD as mentioned before and the other in SKIPNOTIFY. SKIPHD and SKIPNOTIFY should only be visible to ITSUSERS, but SKIPNOTIFY should also only be selectable if SKIPHD is selected. Possible?
-
My main table is SR_TECHS which has tech id and Techname
My second table and block is sr_tech_calendar.
Here tech_name is a non-database field.
When I type J% in the Tech_name field and query, I should be able to get all tech_names
starting with 'J'
How can I get it through pre-query and what should I do in the post-query?you achieve this by setting
set_block_property('blockname',default_where,'give neccessery where condition')
in pre_query trigger
siby -
ADF : Non Database Block Fields Validation
How should I add validation to "Non Database Block Fields"?
My question is based on this example:
see http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html
"24. Passing User-Entered Data in "Non Database Block Fields" to Stored Procedure/Function"
http://otn.oracle.com/products/jdev/tips/muench/stprocnondbblock/PassUserEnteredValuesToStoredProc.zip
Should I add the validation to an Entity Object (where no fields are 'linked' to database fields) on which I base the "NonDBBlock" View Object?
If this is "Entity Object abuse" (because no database involved, only validation), what would be a better approach?
many thanks
Jan Verveckenhi Steve
If all the attributes in my Entity Object are marked as not persistent, it makes sense this Entity Object doesn't "take part" in a transaction.
I would like to avoid the message box about Commit or Rollback when closing my Frame, because this use case isn't transaction related in any way.
It seems to work if I override the getPostState() method like this:
public byte getPostState()
return EntityImpl.STATUS_UNMODIFIED;
question :
Are there any side effects to this approach or is there another way to mark an Entity Object as "not in any transaction"?
thanks
Jan
Maybe you are looking for
-
My macbook pro retina doesn't connect to my office's wifi
I have my mac for a month now. It used to work a little bit but when I lost it I just restart my mac, but now it's not working at all. I don't have any problem getting access to any other network beside the one at my office. I can see the network but
-
My computer freezes when i try to restart from bootcamp. What's the problem?
I have a Macbook Pro (i think 2010 generation), that I had windows 7 installed on boot camp. Now I have Mac OS X Lion installed. I don't remember if I restarted from Windows 7 after installing Lion or not. Now the problem is I want to restart from Wi
-
Export all stories w/ abbreviated tags?
I'm attempting to export all stories (using the .js script) in my new copy of CS4 and it is not giving me the option of selecting abbreviated versus verbose tags for the .txt files. I am pretty sure this option used to be included in earlier scripts.
-
Panorama gets little seam after postprecessing in LR
Hi all Sometimes I get this little seam in a panorama after postprocessing it in LR: http://www.archiviz.ch/download/Bildschirminhalt_erfassen-1.jpg The seam is exactly at the position where the left and the right border of the panorama gets together
-
Can't boot 10.5.8 MacBook Pro from Disk Warrior while restarting using "c"
Hello, I am helping a friend maintain her 2008 MacBook Pro (10.5.8). Have safe-booted several times, and repaired permissions. Since she is having minor issues, I brought over my Disk Warrior v. 4.1 (CD rev. 42) which has done wonders for other Leopa