Master detail form issue retrieving service price automatically
Hi,
I developed a master detail form in order to process service requests.
On details block I'm trying to retrieve automatically service price after I select service name from LOV.
For this purpose I created a application plsql process
declare
v_price service.price%type;
begin
select price into v_price
from service
where service_no = 1;
htp.prn(v_price);
exception when others then htp.prn('An error occurred retrieving the PRICE');
end;
Which process I'm calling through javascript function in order to retrieve service price.
<script type="text/javascript">
function GetServicePrice(pThis)
var vRow = pThis.id.substr(pThis.id.indexOf('_')+1);
html_GetElement('f07_'+vRow).value = new htmldb_Get(null,html_GetElement('pFlowId').value,'APPLICATION_PROCESS=getPrice',0);
</script>
Instead of price it returns this value: "[object Object]".
Is it possible to work as I intended or it should other way around?
I appreciate your help/comments.
Application Express 4.2.1.00.08
Oracle Database 11g Express Edition Release 11.2.0.2.0
Regards,
Tonito99 wrote:
Hi Tom,
I applied these changes on page HTML Header, but now it's not returning nothing.
f07_ (price column) is empty.
<script type="text/javascript">
function GetServicePrice(pThis)
var ajaxRequest = new htmldb_Get(null, $v('pFlowId'), 'APPLICATION_PROCESS=getPrice', 0);
var ajaxReturn = ajaxRequest.get();
$s('f07_'+vRow, ajaxReturn);
</script>
Any other suggestion?
Regards,
Edited by: Tonito99 on Mar 8, 2013 3:32 PMIf you are on apex 4.2 why are you still using the legacy/undocumented methods?
You should use new javascript API apex.server.process
apex.server.process ( "getPrice", {
success: function( pData ) { $s('f07_'+vRow, pData);}
} );
Similar Messages
-
Problems with Master-Detail Form not retrieving Detail Rows
Portal 3.0.7.6.2 on NT
I am having problems with a Master-Detail Form not retrieving Detail Rows. Sometimes it retrieves all, sometimes about 50%, the majority of the time it's not retrieving any. If it never retrieved any I would suspect that the 'join' condition was wrong but that isn't the case. I didn't have this problem with a prior MD Form I created. I have tried re-creating the MD Form but I get the same problem.
Is anyone having similar problems/is this a know bug??
Any help or thoughts are appreciated.I experienced performance problems. The simpiest MD form takes about 10 secs. to requery. I's not answer to your question, but there is more problems with this concept.
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Michael Finch ([email protected]):
Portal 3.0.7.6.2 on NT
I am having problems with a Master-Detail Form not retrieving Detail Rows. Sometimes it retrieves all, sometimes about 50%, the majority of the time it's not retrieving any. If it never retrieved any I would suspect that the 'join' condition was wrong but that isn't the case. I didn't have this problem with a prior MD Form I created. I have tried re-creating the MD Form but I get the same problem.
Is anyone having similar problems/is this a know bug??
Any help or thoughts are appreciated.<HR></BLOCKQUOTE>
null -
Wizard generated Master-Detail form issues
The wizard-generated master/detail forms have several severe usability issues when the "Choose Layout" option is set to "Builder master detail with: edit detail as tabular form on same page".
Some of these issues are:
- The form has two Apply Changes buttons, one to save the master row and one to save the detail row. Users find this very confusing. If you save the master row changes, any changes to the detail rows are lost and vice versa.
- The form has two Delete buttons, one to delete the master row and one to delete the checked detail rows. Users find this confusins also. Clicking the lower delete button discards any other changes that were made.
- The Add Row button also discards any other changes that were made.
The first two issues are easily fixed. With a few simple changes to the generated page, I can make it so there is a single "Apply Changes" button that 1) saves any changes to the master row, 2) saves any changes to detail rows and 3) deletes any checked detail rows.
I cannot figure out how to solve the third issue (that the add row button discards any changes). I can make it so the "Add Row" button saves the changes, but this isn't user friendly either; I don't think any changes should be comitted unless the user specifically presses 'Apply Changes'.
So far, I thought of several ways to possibly fix this but can't get any of them to work. Some of the ideas were:
1. The 'Add Row' button could run the automatic row processing and MRU processes, but not do a commit untill/unless Apply Changes is pressed. I don't think this is feasible because http is stateless and connection pooling may be used, so we can't have a transaction that spans http requests.
2. Move the Add Row process to page rendering so that the detail table always has an empty "add row" row thereby making the Add Row button unnecessary. I tried this, but it looks like the add row process was designed to run during the page processing, not during rendering, and it fails with a divide by 0 error when it is run during page rendering.
3. Use client-side DHTML (instead of the HTML DB add row process) to add an empty row to the html table (i.e. add row button does not do a submit, it is handled entirely on the client). I tried this, but the MRU process fails because it doesn't expect the added row.
If anyone has any other ideas on how to fix this problem, they would be greatly appreciated.
HTML DB solves this problem in the SQL workshop create table wizard.
In HTML DB 1.6, the "Add Column" button does a submit but somehow saves any changes that were entered.
In HTML DB 2.0 beta, client-side DHTML is used (my approach 3 above).
Can someone from Oracle share how the HTML DB create table wizard solves this problem?Eric,
Thanks for your feedback. Iâll add your suggestions to our list of tabular form enhancement request.
The wizard generates a regular form for the master record and a tabular form for the detail records. As you pointed out, itâs quite easy to customize this to your individual needs.
Unlike regular forms, thereâs currently no session state concept for tabular forms, so you either need to write your data to the database, or you will loose any changes if you e.g. paginate. For the same reason, the âAdd Rowâ button and the associated process is generated so that any changes are saved to the database before adding a new row. Of course the MRU process that is executed on âAdd Rowâ can be removed, if that is the preferred behavior.
A work around would be to code the DML processes for tabular forms manually, and temporary store the data in HTML DB collections to simulate a stateful behavior.
In HTML DB 2.0 we started adding DHTML features, such as the create table wizard youâre referring to. Some features, like the pull down menus, will be available to be used in your own applications. Other features, like the DHTML tabular form, wonât be available for custom applications in 2.0.
Regards,
Marc -
Master-Detail Forms (Populating a Foreign Key Automatically)
Master-Detail Form
When inserting a MD Form, the Master ID (e.g. Deptno,the Primary Key) is generated.
How is it possible for this also to be generated in the Detail Form (as the Foreign Key)? The requirement is for the foreign key to be populated automatically.
Any help would be much appreciated.
Thanks.This item is discussed earlier in this group.
It's solved in version 3.0.8
Regards,
Anna -
Hello,
I am unsure if this is a bug or how I'm doing things. I'm using version 4.1.
I am creating a master/detail report (on the same page) using the wizard to create the page. I have no problem creating the page and it works. The only changes I make to the detail region (which is a report) is to set it to display one record at a time, enable partial page refresh and change the layout to a vertical list including null columns. Essentially I want to see one record at a time. I can certainly page through them one at a time. However if I press "Add Row" it creates a new blank record below my existing one. If I keep pressing "Add row" I keep getting more blank rows. Shouldn't this blank row overwrite the currently displayed row so that there is only one row at any given time (whether its blank or a populated line). If I'm saying I only want one shouldn't it only ever display just one record regardless of whether your adding or reviewing existing detail records. It seems to me that if I tell it I only want one row, it shouldn't allow me to keep adding rows indefinitely which end up getting added to rows already on the screen. On a vertical listing with a lot of fields, you could end up scrolling for days.Hi -
My assumptions are:
1) That you have created Master/Detail form with both Master and Detail regions on the same page.
2) The problem of NOT seeing the Detail happens when you are inserting (not updating) on Master,
in other words when you are creating a new user in Master section.
The Detail section (as created by Apex Master/Detail wizard) is a Report with a Condition set for display:
"Value of Item in Expression 1 Is Not Null" with Expression 1 populated with PK of Master.
So, change this condition to None and empty Detail section will appear in Create mode.
Note that you must now set the Form object that holds the PK for new Master record by some means,
(maybe a Page Process or such) before the Save is done, otherwise Detail record will not have FK.
Also you are going to have to play with the Conditions on the ApplyMRU and ApplyMRD Processes created
by the wizard to make sure they are only firing in Create mode when the Save for the whole page is submitted.
Lastly you can clear the values on the page with a Process of type "Clear Cache for all Items on Pages" that fires
last after page submission, again this may need a Condition to prevent clearing items before you are ready... -
Master detail form initial insert issue on details sub-region
Hello,
I created a master detail form with report which should do insertion on master and detail region/subregion.
On insert mode I enter with data master and detail block, when I press "Create" button, insertion happens only on master block (order table) not and on detail block (order_item table).
On EDIT mode it does insertions/updates on master and detail block without problems.
Application Express 4.2.1.00.08
Oracle Database 11g Express Edition Release 11.2.0.2.0
I appreciate your help.
RegardsSomething like this should do the work:
CREATE OR REPLACE TRIGGER order_item_table_tr
BEFORE INSERT
ON order_item_table
FOR EACH ROW
BEGIN
IF :NEW.order_id IS NULL
THEN
:NEW.order_id := v ('P1_ORDER_ID');
END IF;
END order_item_table_tr;
/Make sure the Automatic Row Processing (DML) of the order table returns key into item > Return Key Into Item > P1_ORDER_ID (or however the primary key of the order table is named)
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
------------------------------------------------------------------- -
More than one Detail table in the Master Detail forms!
Hi,
I need to have more than one Detail table in Master Detail Forms.
I want to see the details of the rows of the first Detail table in the Second Detail table. Please guide me to do this.
Sincerely yours,
MozhdehYou can do one of two things
1) Depends on the nature of your data model. I was able to manage many to many
relationships using views and instead of triggers. This solution is somewhat complex but can work in certain situations.
2)Works for situations where master record exists. create a page with mulitple portlets syncronized on some related key.
create the following package to use on the md forms to place on the one page to be rendered.
-- this package will facilitate the storage and retrieval of keys used by the related forms.
create or replace package session_var
IS
session_parms portal30.wwsto_api_session;
g_domain varchar2(2000) := portal30.wwctx_api.get_user;
function get_id (id in varchar2) return number;
PROCEDURE SET_ID
(ID in VARCHAR2
,p_val in VARCHAR2
,P_URL in VARCHAR2
END SESSION_VAR;
create or replace package body session_var
IS
--pkg body
function get_id(id in varchar2) return number is
l_store_session portal30.wwsto_api_session;
l_id number;
begin
l_store_session := portal30.wwsto_api_session.load_session(
p_domain => session_var.g_domain,
p_sub_domain => 'your domain');
l_id := l_store_session.get_attribute_as_varchar2( p_name => id);
return l_id;
end get_id;
PROCEDURE SET_ID
(ID in VARCHAR2
,p_val in VARCHAR2
,P_URL in VARCHAR2
IS
l_store_session portal30.wwsto_api_session;
begin
l_store_session := portal30.wwsto_api_session.load_session(
p_domain => session_var.g_domain,
p_sub_domain => 'your domain');
l_store_session.set_attribute(
p_name => id,
p_value => p_val );
l_store_session.save_session;
* Redirect to the page using p_url;
portal30.wwv_redirect.url(P_URL);
end set_id;
END SESSION_VAR;
--the form master detail form, section before display page enter the following code and publish as portlet.
declare
l_fs varchar2(4000);
l_s varchar2(4000);
v_con_id number;
begin
v_con_id :=rfq.session_var.get_id('CON_ID'); -- primary key and key used to relate details
p_session.set_shadow_value( p_block_name => 'MASTER_BLOCK',
p_attribute_name => 'A_CON_ID', -- attribute on form related to primary key
p_value => '= '|| v_con_id,
p_language => portal30.wwctx_api.get_nls_language ,
p_index => 1
l_fs := p_session.get_value_as_varchar2(p_block_name => 'MASTER_BLOCK', p_attribute_name => '_FORM_STATE');
l_s := p_session.get_value_as_varchar2(p_block_name => 'MASTER_BLOCK', p_attribute_name => '_STATUS');
if l_fs = 'SAVE' and l_s is null then
WWV_MASTER_GENSYS_1(p_block_name => p_block_name,
p_object_name => p_object_name,
p_instance => p_instance,
p_event_type => p_event_type,
p_user_args => p_user_args,
p_session => p_session);
p_session.save_session;
end if;
if l_fs = 'QUERY_AND_SAVE' and l_s is null then
WWV_MASTER_GENSYS_1(p_block_name => p_block_name,
p_object_name => p_object_name,
p_instance => p_instance,
p_event_type => p_event_type,
p_user_args => p_user_args,
p_session => p_session);
p_session.save_session;
end if;
exception
when others then
PORTAL30.wwerr_api_error.add(PORTAL30.wwerr_api_error.DOMAIN_WWV,'app','generic','onLink', p1 => sqlerrm);
raise;
end;
--then create other md forms and publish as portlets in a similar manner.
-- create a form (form_session_vars) to call procedure session_vars and place the following code in the
addiontional pl/sql tab
WWV_GENSYS_1(
p_block_name => p_block_name ,
p_object_name => p_object_name,
p_instance => p_instance ,
p_event_type => p_event_type ,
p_user_args => p_user_args ,
p_session => p_session);
--then create a page and place the md forms created above as portlets on the page.
--create a link and target the form_session_vars and in the link target inputs
enter the values for your user parameters
id= CON_ID --"your primary key name"
p_url= url/page/"your_page"
--finally create a report (QBE or standard).
in the column formation section use the link created earlier to direct the user to the target page.
How it works.
When the link is selected the form_session_Var is called and automatically runs setting the primary key values
in the user session store. The step is required or the resulting page will not render properly. Then the user is redirected to the page where the portlets are rendered. The portlets start rendering, the before display page calls the session vars package to retrieve the key and put the form into query_update mode returning the data.
The portlets finish in query_and_save mode with details in update mode, the allowable insert, delete and none actions will be available for the details.
benefits: The session_Var package code is resuable as well as the form form_session_Var and the link. passing the key name and values are done at the report level and detailed in the report links. the md forms will need to reference their related keys. -
Adding button to report to link to master detail form
I want to add a button to a report to direct me to a blank master detail form to insert a new record. I have used the following code in the additional PL/SQL code section:
htp.formopen('PORTAL30.wwa_app_module.new_instance?p_moduleid=1271601405');
htp.formsubmit('p_request','Create New');
htp.formClose;
When I click this I get 'Page Not Found'.
But if I hit refresh I am directed to the correct form with the same url.
Any ideas on what the issue is?
Thanks.Hi,
Check this sample code.
tables:sscrfields. "Fields on selection screens
selection-screen function key 1.
selection-screen function key 2.
Initialization.
sscrfields-functxt_01 = 'Report'.
sscrfields-functxt_02 = 'Exit'.
at selection-screen.
if sscrfields-ucomm = 'FC01'.
perform f_alv_sub.
elseif sscrfields-ucomm = 'FC02'.
endif.
Hope it helps. -
Requerying on Master Detail form
Hi,
Does anyone know how to set up PL/SQL code to automatically requery on a master detail form after insert/update? For example, if I insert a record on the master part of the form, I would like that record to automatically show up after the insert/update. Also, if I insert a record on the detail part of the form, I would like that record to automatically show up after an insert/update.
Thanks,
MartinHi Krishnamurthy,
Thank you very much for the code. The code for the most part acts like I want it to except when I initally insert a master record. In my case, I have the form set up so you have to insert a master record before you can insert any detail records. Therefore, after the user clicks save, that master record needs to come up. The code you gave me only brings up the current master record if you are inserting detail records (which is great, that is what I want it to do). I have modified the code you gave me so when a user is just inserting the master record, the master record automaticaly comes up rather than the first record in the table. However my code makes the form run slow (about 13 seconds to save). Do you know of another way that I can make the form act like I want it to. Below is my code.
Thanks again,
Martin
declare
l_msg varchar2(255);
l_key_value number(10);
l_key_value2 number(10);
v_get_id number(9);
v_check_detail number(9);
CURSOR GET_ID IS
SELECT MAX(A.PCH_ID)
FROM PORTAL30.PCHEADER A;
CURSOR CHECK_DETAILS IS
SELECT DISTINCT B.PCD_ID
FROM PORTAL30.PCDETAILS B WHERE B.PCD_PHC_ID = v_get_id;
begin
/*get the key field value from the Master Detail form to requery the details since the form will be cleared out after update */
l_key_value := p_session.get_value_as_NUMBER(
p_block_name => 'MASTER_BLOCK',
p_attribute_name => 'A_PCH_ID',
p_index => 1
doSave;--- This is the default handler
OPEN get_id;
FETCH get_id into v_get_id;
CLOSE get_id;
OPEN check_details;
FETCH check_details into v_check_detail;
IF check_details%NOTFOUND
THEN
CLOSE check_details;
/*get the key field value from the Master Detail form to requery the details since the form will
be cleared out after update */
l_key_value2 := v_get_id;
/*get the message which is going to be displayed after update */
l_msg := p_session.get_value_as_varchar2(
p_block_name => 'MASTER_BLOCK',
p_attribute_name => '_STATUS');
/*now set the key field value in the Master Detail */
p_session.set_shadow_value(p_block_name => 'MASTER_BLOCK',
p_attribute_name => 'A_PCH_ID',
p_value => l_key_value2,
p_language => PORTAL30.wwctx_api.get_nls_language);
WWV_MASTER_GENSYS_1(p_block_name => null,
p_object_name => null,
p_instance => null,
p_event_type => null,
p_user_args => null,
p_session => p_session);
/*put the message(like 'Updated one master record' ) back in the screen */
p_session.set_value(p_block_name => 'MASTER_BLOCK',
p_attribute_name => '_STATUS',
p_value => l_msg);
p_session.set_value
(p_block_name => 'MASTER_BLOCK'
,p_attribute_name => '_MASTER_ACTION'
,p_value => 'NONE');
p_session.save_session();
ELSE
CLOSE check_details;
/*get the message which is going to be displayed after update*/
l_msg := p_session.get_value_as_varchar2(
p_block_name => 'MASTER_BLOCK',
p_attribute_name => '_STATUS');
/*now set the key field value in the Master Detail*/
p_session.set_shadow_value(p_block_name => 'MASTER_BLOCK',
p_attribute_name => 'A_PCH_ID',
p_value => l_key_value,
p_language => PORTAL30.wwctx_api.get_nls_language);
WWV_MASTER_GENSYS_1(p_block_name => null,
p_object_name => null,
p_instance => null,
p_event_type => null,
p_user_args => null,
p_session => p_session);
/*put the message(like 'Updated one master record' ) back in the screen*/
p_session.set_value(p_block_name => 'MASTER_BLOCK',
p_attribute_name => '_STATUS',
p_value => l_msg);
p_session.save_session();
END IF;
END; -
Master Detail Form - unable to add detail row
Dear,
I have a test application that runs for years on apex.oracle.com.
Since 3rd of june 2010 I am unable to add rows on a detail form.
Any ideas?
Help is welcome!
Kind regards
Lorenz4.0 Conversion Issue
Lorenz stated I can create the orderheader, but unable to create orderlines.Simply nothing happens, when I click the add row button.>
I share the same issue as Lorenz, on a Master/Detail form, I am able to create my Master row and but nothing happens when attempting to create detail rows. I was able to switch my application to theme 13 (Traditional Blue) from 2 (Blue and Tan) and was then able to create and add details rows.
My dilemma. When switching to theme 13 and others, none appear to support Two Level Tabs in the same manner as Theme 2. Essentially the applications look and feel is not going to go over well with my user base of 3+ years.
Is there another standard theme that will support Two Level Tabs like Theme 2 and allow the addition of detail rows on a Master/Detail form?
Is this a reported 4.0 conversion issue?
Jeff -
Master Detail Form - How 2 update a field in the Detail form using a query?
Hello,
I have a master detail form with, each master record having a fixed(6) number of detail records. One of the fields in the detail record is the PART_DESCRIPTION field. I am trying to update this field by querying Table_X. TABLE_X is in the format of (desciption id, description). Description id runs from 1 to 6.
When the form displays, the PART_DESCRIPTION field for the 6 detail records needs to be automatically populated with the six values of description stored in Table_X. How can this be done?
Tried using session storage objects, but made no headway.
Would greatly appreciate pointers on how to go about doing this.
Thanks.
DevIf you are on a Portal Version lesser than 3.0.9.8.3, then please try the following to populate
the PART_DESCRIPTION field.
Steps:-
1> Edit the form and go to the Additional PL/SQl section and put the following code in the
"...after displaying the page area" :-
declare
type t_vc_arr is table of varchar2(4000) index by binary_integer;
l_arr_desc t_vc_arr;
l_form_name varchar2(200);
l_form_state varchar2(500);
begin
l_form_name := p_session.get_module().get_name();
l_form_state := p_session.get_value_as_varchar2(
p_block_name => 'MASTER_BLOCK',
p_attribute_name => '_FORM_STATE'
if l_form_state = 'QUERY_AND_SAVE' then
select description
bulk collect into l_arr_desc
from <schema>.table_x;
htp.p('
<script>
var descArr = new Array();
var Fidx = 1;
var formObj = document.WWVM'||p_session.get_id()||';
var fieldName = "'||l_form_name||'.DETAIL_BLOCK.PART_DESCRIPTION.0";
for i in 1..l_arr_desc.count loop
htp.p('descArr['||to_char(i-1)||']="'||l_arr_desc(i)||'";');
end loop;
htp.p('
for (var i=0; i < formObj.length; i++){
if (formObj.elements.name == fieldName+Fidx){
formObj.elements[i].value = descArr[Fidx-1];
++Fidx;
htp.p('</script>');
end if;
end; -
Is this a bug? master rowid value lost when saving on a master/detail form
master/detail forms seem to lose the rowid after saving, if the unique identifier is set to ROWID
to reproduce the problem:
1) create a master detail form on DEPT/EMP
-- choose 'Managed by Database (ROWID)' on the 'Define Primary Key' page.
-- do not include master row navigation (but i don't think this matters)
-- choose 'Edit detail as tabular form on same page' on the 'Choose Layout' page
-- include the master report
2) on the master/detail page, change the conditional branch that returns to the master report page
-- the normal condition for this branch is request in SAVE,DELETE,CREATE
-- change it to request in DELETE,CREATE
3) run the form and save a change
-- saves fine, session shows the ROWID value is still set
4) save a second change
-- change does not save, form reverts to Create mode
this problem does not occur when using the primary key columns instead of rowid
see http://apex.oracle.com/pls/apex/f?p=60813:7 for the ROWID version
see http://apex.oracle.com/pls/apex/f?p=60813:11 for the PK column versionHi Saverio,
Bug *13563808* has been logged to track the reported issue, and a fix will be made available in a future release. Just to clarify, this issue is only arising when the APEX-generated Master-Detail is modified post-generation, so for users who have not modified their Master-Details using ROWID to manage their DML processes, they should not experience this issue.
In relation to my workaround, my suggestion works in my test environment, which I verified before posting the initial suggestion. Please note that the 'Reset Page' process is, by default, conditional on the "Delete" button being pressed. If you have made further modifications to your Master-Detail page, then this might explain why you're seeing different behaviour to me. You might using the "Debug" option on the Developer Toolbar useful. Viewing the debug information should help you to decipher what's going on/wrong on your page. If you still can't resolve the issue, then the safest option might be to revert the page back to it's original state, meaning the user navigates back to the Report page upon submitting changes to the Master-Detail Form page.
Regards,
Hilary -
How to determine the ROWNUM in a Master Detail Form
Hello,
I am working in a Master Detail Form with Orders and Order Items Information; and I created a process that allows the users to select a Product ID on a tabular form, and the next column is populated automatically with the Product Description.
To achieve that, I followed some instructions by Denes Kubicek (http://apex.oracle.com/pls/otn/f?p=31517:241), but my case is slightly different:
<ul>I am using a wizard-created tabular form, instead of a manual tabular form; and </ul>
<ul>Instead of using another page as a Popup to pass the parameter of the ROWNUM, I am using a plug-in called “Tabular Form Super LOV” which is a modified version of the SkillBuilders’ Super LOV that works on Tabular Forms. </ul>
The Product ID is returned in the correct row by the plug-in; but in the case of the Product Description, it is always returned into the first row; and my problem is that I don't know how to determine the row where the user clicked to call the plug-in.
I set up an example in apex.oracle.com in case someone would like to look at it:
Workspace: ediazjorge
Username: test
Password: test
App Name: Sample App
App Number: 1550
BTW, I am using Apex 4.1.1.00.23 and Oracle DB 10.3.2.
Thanks in advance,
ErickHello VC,
Thank you for your time and help.
Unfortunately, it is still not working properly:
1. When the Popup LOV opens, the first row of the tabular form is 0, the second row is 1, and so on. How can I assign the values starting with 1 and in the format *0001* ? (I am still a novice on Apex and new to JavaScript :-), sorry about that).
--2. Also, when I close the Popup LOV, the value of P1_ROWNUM is ‘undefined’ again so I'm not sure if the Product Name column will be populated.--
3. And finally, you are using the jQuery Selector uPopupLOVIcon, which is an attribute of the Cloudy Theme. In my real application (Apex 4.1.1.00.26), my element looks like: *<img src="/i/lov_16x16.gif" width="16" height="16" alt="Popup Lov" alt="List" style="vertical-align:middle;" align="middle" />*. What do you recommend me to use as a jQuery Selector?
Again, I really appreciate your help and time. I think you solved the most difficult part.
Thank you so much,
Erick
Update: I just found out that the problem with my comment 2 is because I didn’t delete the previous dynamic action that set the value to P1_ROWNUM.
Edited by: ediazjorge on Sep 18, 2012 11:20 AM -
Inserting records in master detail form
I am moving an existing Webdb Application to portal. In the application there is a master detail form along the following lines
Dept Id: 10
Dept Name: IMS
Employee ID Employee Name etc
1586 Julie Wilks
Currently users can insert/update/delete detail lines. When inserting, the dept_id foreign key is automatically inserted into the dept_id column in the detail table. My understanding is that for some reason this does not happen in portal. Instead, the user is expected to input any foreign keys manually. As this could lead to all sorts of problems I'd rather not have to do this.
Has anyone found a means to get around this problem?
If solutions have already been posted, please point me in the right direction as a search on the forum hasn't come up with anything.
Many thanks,
Julie WilksHi,
Am I the only one having this problem?
Thanks,
Diana -
Master-Detail Form - implementing some thing like Post-Query trigger
Hi all,
I am struggling to implement an eqivalent of a post-query trigger in Oracle Forms. Please bear with me as I am trying to explain in detail what the problem is.
Here is my situation.
I have three tables EMP, DEPT and LOCATION. I created a Master/Table pages on EMP and DEPT.
Basic relationships.
Each LOCATION has one or more DEPTs; Each DEPT is at one and only one LOCATION.
Each DEPT has one ore more EMPs; Each EMP is assigned to only and only DEPT.
Not getting too complicated, here are the table layouts:
LOCATION:
ID number(10,0) not null,
NAME varchar2(20) not null
DEPT
ID number(10,0) not null,
NAME varchar2(20) not null,
LOC_ID number (10,0) not null foreign key from LOCATION
EMP
ID number(10,0) not null,
NAME varchar2(20) not null,
DEPT_ID number (10,0) not null foreign key from DEPT
Assume I have all the constraints, BIU triggers, sequences defined properly.
I am using the APEX page wizard to create a Master/Detail Form on DEPT and EMP. The first page is the Master Report on DEPT. I want to display the Location Name on this page also. Because the Master Report allows
you to change the query, I was able to add the Location Name as part of the
query. This was very simple.
Select a.name "Department_Name",
b.name "Location"
from dept a, location b
where a.loc_id = b.id
Moving on, In the Master Detail Form, I would like to get the Location Name as part of the first Region (Dept Region).
In this region, I would like to include the Location Name also. So my first region on the Master Detail form includes:
Dept Id: ________
Dept Name: _______
Location Name: __________
As Region are automatically populated using using a Fetch Row from EMP table (Automated Row Fetch) on an After Header process point, I don't have a way of including the Location as part of query. So I created a Region level Item called Location Name, made it Display only.
In the old SQL*Forms, or Oracle Forms days, I used to use a Post-Query trigger, or Post-Change trigger to fire on the Loc_Id column to populate the Location Name. Simple fetch like:
Select name
into :P80_location_name
from location
where loc_id = :P80_loc_id
However, I am struggling to implement some thing simple like this in APEX. Tried creating a processes, computatations etc, but nothing is working.
I have seen some previous responses to fetching values from a foreign table
using a button or AJAX script, but this should be very basic. What am I
missing here?
Appreciate any insights.
Thanks.
JohnHi John,
I'm not too familiar with the post-query triggers in Oracle Forms, but the use of a List of Values (LOV) on your LOCATION table might do the trick for you. If you create a dynamic LOV based on your LOCATIONS table, it can then be referenced by the LOC_ID item on the Master-Detail page, to display the Location Name. You could try doing the following:
1. Create a new dynamic LOV, LOCATIONS, using a query similar to the following:
select Name d, ID r
from LOCATION
order by 1
2. Edit the "Create" button on the Master report page, and in the "Optional URL Redirect" section set "Request" to CREATE. Click Apply Changes, to save the setting.
3. Edit the LOC_ID item on your Master-Detail page, and set the following:
* in the "Name" region change the "Display As" setting to Select List
* in the "Label" region change the Label to Location Name.
* in the "List of Values" region set the "Named LOV" to LOCATIONS
* in the "Read Only" section, set the condition to Request != Expression 1, and set Expression 1 to CREATE.
Click Apply Changes to save the settings.
When you run the pages now, the Location Name field will appear as Read-Only when editing a selected Master row. The item will appear as a Select List when the user clicks "Create" on the Master page, to create a new Master row.
I hope this helps.
Regards,
Hilary
Maybe you are looking for
-
I have all my devices set up with the same iCloud id. Though, when I create a new contact on my iPhone, it syncs to my iPad, but not to my macbook, and not to www.icloud.com. Is anyone having similar problems ?
-
How to make a form Dynamic(Serious Issue)
Hi, I have a problem. How to make an Interactive form Dynamic while saving it in NWDS(NetweaverDeveloperStudio). Helpful answer is highly rewarded and Highly Appreciated.
-
Why are my pictures not showing up in Photo Stream?
Ok, I have set up upgraded everything to the correct versions. I have set up and enabled Photo Stream on my iMac and on my iPhone. I have enabled Photo Stream on the iPhone. I have set up my iCloud services. I can drag pictures to the Photo Strea
-
Color Differences Between Vendors
I have a CMYK formula of 10-25-60-25 that I use as a background color for a client. I don't "convert" those colors, they are in fact the exact same formula in whatever application is being used. I have printed banners, table covers, posters, flyers,
-
when i create a new bookmark, it is automatically filed in "recently bookmarked" rather than the folder i choose. when i subsequently go to the "recently bookmarked" folder, drag and drop the bookmark in a different folder, there will be 1 in the fol