Apex 4.0 broke my removeNullValues application process
I'm having a devil of a time finding why my process integer applicatio, which replaces the parameter of "null" values % with a real NULL, has stopped working. The session view indicates that page elements are always linked with "null %" so it suggests something is off with the following search query.Maybe something changed with the definition of APEX_APPLICATION_PAGE_ITEMS? What follows is based on messages from the forum here long ago for this problem to the APEX 3, so I guess everyone who did it and need to upgrade is to be bitten by the same bug. Is there a new and preferred way to handle this? I did some digging here, but saw nothing in the last 90 days.
Tangent: it's a shame that 4 APEX is not only to take care of that. Or does?
Application process: RemoveNullValues
Point process: submit to the: after the layout of Page - before the calculations and Validations.
BEGIN
wwv_flow. Debug ('Application process RemoveNullValues!');
FOR rItem IN
(SELECT NOM_ELEMENT
OF APEX_APPLICATION_PAGE_ITEMS
WHERE APPLICATION_ID = TO_NUMBER(:APP_ID)
AND PAGE_ID = TO_NUMBER(:APP_PAGE_ID)
AND LOV_DISPLAY_NULL = 'Yes'
AND LOV_DEFINITION IS NOT NULL
AND LOV_NULL_VALUE IS NULL
)
LOOP
wwv_flow. Debug ('DEBUG' | rItem.ITEM_NAME |) ': ' || V (rItem.ITEM_NAME));
IF V (rItem.ITEM_NAME) = "% null."
THEN
Apex_Util.set_session_state (rItem.ITEM_NAME, NULL);
END IF;
END LOOP;
END;
After debug output, nothing is never returned by this query, then maybe that is no longer a valid way to get the LOV page elements? Is there a better way to do this? The Application Builder Guide and reference on the API had nothing on the subject (and should, each APEX developer should not tackle the problem "null %" somehow?)
Thanks for the tips!
APEX 4.0, we have removed this behavior of null % weird with LOVs, but because of backward compatibility (someone might expect this value) we filled all the LOVs existing null % during the upgrade/import.
All new LOVs you create have null % more unless you set.
But there is more good news, there is a sorcerer in APEX 4.0 that eliminates the % of all LOVs null if you know that you need in your application. So, it is unnecessary for your process.
Go to the request Builder\
Concerning
Patrick
-----------
My Blog: http://www.inside-oracle-apex.com
APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
Twitter: http://www.twitter.com/patrickwolf
Tags: Database
Similar Questions
-
Sending page apex to the application process (JSON) values
Hi all
A page 5 apex has a value in a hidden item, P5_CLASS
In the apex 5 page, I wrote a JavaScript to call for a process of application (PL/SQL) to retrieve the values of a table on Page 5.
var ajaxRequest = new htmldb_Get (null, & APP_ID., 'APPLICATION_PROCESS is Get_Class_Data', 0);
and I use the JSON object to display the rows in the table.
-----------
Problem
-----------
It works pretty well. But I need to send the value of the hidden element P5_CLASS to Get_Class_Data so that I can ask P5_CLASS-basedapplication process.
Help, please.Shiva says:
Thank you Paul,.So I can use
var ajaxRequest = new htmldb_Get (null, & APP_ID, 'APPLICATION_PROCESS = GET_CLASS_DATA', 0);
ajaxRequest.add ('F15_GLOBALVAR', $v ("#P5_CLASS")) to send the value to the application process?(F15_GLOBALVAR is an application-level element, I created in the shared components)
And to use this application in my sql in GET_CLASS_DATA, I can use sql... where class =: F15_GLOBALVAR?
Yes.
(Please zip code wrapped in \
...\
Tags to preserve the special characters and formatting.)
-
Running APEX application process
Hello!
Application process (with htp.p in it) is not running when onSubmit process page returns the error (and shown in the notification bar).
How can I make the process to run? Or is it a bug?
You can see example in the application of test Report 1
Just press the "SUBMIT" button and see difference about the expression "'application process is here" at the top. "
Thank you!
You can do this by using a chain of substitution as mentioned above. Rather than display the results of the query of the user using lifestyle
htp.p
, create aUSER_STYLES
application point and store them in it:declare l_user_styles varchar2(4000); begin for cur in (select t.param, t.value from USERDATA t where t.authid = :APP_USER and t.application = :APP_ID and t.page = :APP_PAGE_ID) loop l_user_styles := l_user_styles || '#' || cur.param || ' {' || cur.value ||'}'); end loop; :user_styles := ''; end;
The application can then be referenced in heads of page template using the substitution string syntax:
&USER_STYLES.
This approach is more effective than what you try to do what the style of the user information must be defined in the application element when connecting and when the styles are changed, rather than on each page show that you propose.
-
Is there a problem with APEX Application processes and the CAE?
I have a table that has a political function. When I select in the table directly from the page, it seems to be only return lines appropriate for the user.
But, when I select from the same table using an application process (On Demand), PL/SQL block.
BEGIN
OWA_UTIL.mime_header ("text/xml", FALSE);
HTP.p ('Cache-Control: non-cache');
HTP.p ('Pragma: non-cache');
OWA_UTIL.http_header_close;
HTP.prn ("< select >");
FOR c IN (SELECT '1' o)
name | ' (' | school |) ')' d,
pk_id r
OF sch_base
WHERE pk_id = nvl(:REFRESH_LOV_PK_ID,'null')
UNION
SELECT '2' o,
'%' d,
r 'null %.
OF the double
UNION
SELECT '3' o,.
name | ' (' | school |) ')' d,
pk_id r
OF sch_base
WHERE pk_id <>nvl(:REFRESH_LOV_PK_ID,'null')
ORDER BY 1, 2)
LOOP
HTP.prn ("< option value ="' | c.r |) '">' ||
c.d | ("< / option >");
END LOOP;
HTP.prn ("< / select >");
END;
It returns all rows in the table.Try something like
var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=' + pApp,$v('pFlowStepId') )
CITY
-
AJAX and APEX wooes application process
I have an interesting problem where JavaScript is running and that it not postbacks, as I confirmed this by looking at the html via Firebug events but On Demand process does not (confirmed through a debugging log table). What has to be really puzzled is that right after I created the application process, it worked perfectly up until some time after I left the game and returned. Can anyone offer any suggestions?
JavaScript in the Page header:
Request for application process:<script language="JavaScript" type="text/javascript"> function f_checkid () { var get = new htmldb_Get(null,$x('APP_ID'),'APPLICATION_PROCESS=CheckID',0); get.add('P20_STAFF_ID',html_GetElement('P20_STAFF_ID').value) gReturn = get.get(); if(gReturn) { var sepPos = gReturn.indexOf("|"); html_GetElement('P20_STAFF_PIDM').value = gReturn.substr(0,sepPos); html_GetElement('P20_NAME').value = gReturn.substr(sepPos+1); } else { html_GetElement('P20_NAME').value = 'Invalid: None Selected or ID is Invalid!' } get = null; } </script>
Name: CheckID
JavaScript function is triggered onBlur in P20_STAFF_ID.DECLARE idn varchar2(1000); id number(8); BEGIN SELECT FUNCTIONS.PROCESSID(:P20_STAFF_ID) INTO id FROM DUAL; SELECT TO_CHAR(id) || '|' || FUNCTIONS.GETNAME(id) INTO idn FROM dual; IF(TRIM(REPLACE(idn,'|','') IS NOT NULL) then HTP.prn (TRIM(idn)); end if; INSERT INTO DEBUG (VAL1,VAL2) values (idn, id); commit; END;
Hello
Are you sure that your code in the process is correct
This line seems incorrect to me
IF (Trim (Replace(IDN,'|','') IS NOT NULL) then)It should instead be
IF TRIM (REPLACE (idn,'|)) ((', ") {color: #ff0000} *) * {color} IS NOT NULL thenBecause I think that you close your clause works
-
Redirection of the application process
Hello
When we try to redirect using the application process get below error.
When the same process is tried to process Page it works fine.
We use 5 APEX. Tried owa_util.reirect_url and apex_util.redirect_url.
Any ideas?
Hi Arun,
Why don't you use a branch?
If you cannot you must always use apex_util.redirect_url. Can you provide an example of code you used? As it seems that the browser actually receives the redirection, but it seems that it is not correct. Use the function "Check system" and tab Net of Firefox to have a look at the answer and after that is returned by the server.
Concerning
Patrick
-
Call javascript application process
I use 5 APEX. I have a page that I use a button to call js and dynamic action.
I created the button on my page with action "Defined by the dynamic Action" and static id "ajax".
I added this js on my page 'function and declaration of global variables ' section:
$('_#ajax').click (function () {}
var ajaxRequest = new htmldb_Get (null, & APP_ID., 'APPLICATION_PROCESS is getId', 0);
var ajaxResult = ajaxRequest.get ();
Alert (ajaxResult);
$.ajax({)
url: " http://10.25.7.84/WS/selectionService/currentSelection/student ",
type: 'POST',
data type: 'json ',.
contentType: "application/json",
data: ' {'mode': 'set', 'ID': "[" + ajaxResult + "]","page": 1, "pageSize": 20 "}'
});
Alert (' we need to find a better message - value current selection complete ');
});
I have created a process called 'getid ':
DECLARE
p_app_id NUMBER: = 100;
p_page_id NUMBER: = 13;
BEGIN
...
END;
2 questions:
(1) I want this application process to be reusable for multiple pages/applications, so I need to replace the hard-coded "p_app_id", "p_page_id" with something I can put on each page. What is the best way to do it? Elements of the application? How and where should I set up on the page?
(2) in my js, I don't want to hard-code the IP address in the URL. url: "http://10.25.7.84/ws/selectionservice/currentselection/student". "" Y at - it something that I can use so that it uses the IP that APEX was running on?
Hi bobmagan,
bobmagan wrote:
I tried, but it doesn't seem to work. The application process worked when I had coded the 2 variables. Don't know if its something in the code, that's why I've included pieces that use 'p_app_id' and 'p_page_id '.
You can access the app ID and the ID of the Page in javascript and send it to your AJAX process as follows:
- JS code:
$('#ajax').click(function(){ var ajaxRequest = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=getId',0); ajaxRequest.addParam('x01',$x('pFlowId').value); ajaxRequest.addParam('x02',$x('pFlowStepId').value); var ajaxResult = ajaxRequest.get(); //alert(ajaxResult); $.ajax({ url: "http://10.25.7.84/ws/selectionservice/currentselection/student", type: "POST", dataType: "json", contentType: "application/json", data: '{"mode":"set","ids":"[' + ajaxResult + ']","page":1,"pageSize":20}' }); //alert('We need to find a better message - Set Current Selection Complete'); });
- AJAX PL/SQL process:
DECLARE p_app_id NUMBER := APEX_APPLICATION.G_X01; p_page_id NUMBER := APEX_APPLICATION.G_X02; BEGIN ... END;
Kind regards
Kiran
-
Redirection of PL/SQL in application process
Hi all
APEX 4.2 - Oracle 10g
I read the forum here and the web. I'm not getting a redirect page 1 of PL/SQL code successfully in an application process.
I see in other forums that the developers achieve success with the code below.
Application process runs a PL/SQL block On anonymous, Load: before header.
The code I am using has been tested and it fires properly. The problem lies in the actual redirect lines (owa_util.redirect_url).
Begin
If [a clause] = True then
HTP.init;
owa_util. REDIRECT_URL ('f? p = & APP_ID.:1: & APP_SESSION.');
apex_application.stop_apex_engine;
end if;
END;
Looks like the browser (IE 8.0.7601.17514) trying to open the following...
.../f?p=4000:RUN_PAGE:5795566109287:BRANCH_TO_PAGE_ACCEPT:no::FB_FLOW_ID,FB_FLOW_PAGE_ID,F4000_P1_FLOW:1284,4,1284
Wherever I expect what follows
... / f ? p = 1284:1:8744058503342:NO:
Any help appreciated.
Neil.
The code works fine.
The process page is triggered before * every * page load. So there loop of redirection to page 1 and more.
I added a condition to exclude the redirect if the current page is page 1
I love an easy solution!
-
The clarification of application process
Hello
I am faced with a simple application process in the apex 4.2 version
I have a page - which has a javascript function:
clearMessage (ITAC) function
{
get var = new htmldb_Get (null, & APP_ID., 'APPLICATION_PROCESS is assignment_update', & APP_PAGE_ID.);
get.addParam = ("x 01', CITA);
var output = get.get ();
obj = jQuery.parseJSON (output);
Apex. Submit({Request:'submit',showWait:true});)
}
With an application on request process:
declare
l_value varchar2 (200): = wwv_flow.g_x01;
Start
app_public.assignment_update (l_value,
: APP_ID,.
: APP_PAGE_ID,.
(: APP_USER);
end;
The problem is when the procedure works - he goes l_value with a null value.
Why pointers that will help a lot!
Thank you very much
JAS
Hello
Just for info. Do not use undocumented htmldb_Get JavaScript function.
You must use apex.server.process.
Kind regards
Jari
-
4.2 DOC BUG: all about the application process
"There is an error in Oracle Application Express Application Builder User Guide version 4.2 §8.8.1 " "on the implementation of the application process":
A process On Demand is a special type of procedure of demand that has a Point of On Demand process and executes when it is called from a process On demand page level or a browser AJAX call. On-demand processes are useful when you have logic of PL/SQL that you want to run different execution points on several pages.
At the request of the process generally must be created on a page and not at the level of the application. On request, process created at the application level are created with an initial authorization scheme of must not be Public user. This prohibits the process invoked with users in authenticated sessions.
As it is perfectly possible (and desirable) at the request of the application process to be invoked, [that] by authenticated users, this should probably read:
A process On Demand is a special type of procedure of demand that has a Point of On Demand process and executes when it is called from a process On demand page level or a browser AJAX call. On-demand processes are useful when you have logic of PL/SQL that you want to run different execution points on several pages.
At the request of the process generally must be created on a page and not at the level of the application. On request, process created at the application level are created with an initial authorization scheme of must not be Public user. This forbidden process be invoked from users not authenticated sessions.
In addition, the second paragraph is a new addition to the documentation for APEX 4.2. What is the reasoning for not creating processes on request at the application level? I've used them for a few years as a way to provide reusable, application- wide (for example, the file downloads and the AJAX content) only items authenticated Apex sessions.
Hello
Thanks again. I added a note to the 5.0 docs.
It is certainly very good create processes at the level of applications On Demand. However, if a process is tied to a single page, only, it is immediately obvious that the process belongs to the interface of this page. It's good from a maintenance point of view, because if you only use application-level processes, it may be more difficult to determine if the process is still in use and where it is called from.
Kind regards
Christian
-
How to set the value of the point of application using pl/sql in the application process
Hi guys,.
I want a global variable (application point) whose value will be set to start when a user logs on to the application. The value will be retrieved from the database by using a sql query. I don't exactly know the syntax to set the value of the point of application in the application process. Also, I want to know what type of enforcement process should I use to set the value of the point of application, when a user starts a session. The value of the point of application varies from one user to the user.
Help, please.
I use apex 4.2
Kind regards
Waqas
You can use the application element as a link with his name. That is to say. your point of application is named G_MY_APPLICATION_ITEM, then you can / set of access using: G_MY_APPLICATION_ITEM.
For example
BEGIN
-assign as a variable
: G_MY_APPLICATION_ITEM: = 'LARRY ';
--
-use in a SQL statement
SELECT WHATEVER_COLUMN
IN: G_MY_APPLICATION_ITEM
FROM MY_TABLE
WHERE USERNAME =: APP_USER
;
END;
Peter
-
To access the settings of ajax in the application process
Hello
I have an ajax call, submitting a parameter called cBoxKey.
var get = new htmldb_Get(null,$v('pFlowId').value,'APPLICATION_PROCESS=TrackRows',0); get.add('cBoxKey','NOTREQUIRED'); get.get();
In the application process I can access the parameter 'cBoxKey' like below;
declare l_checkBoxKey varchar2(4000); begin -- -- Get the value of the global which will be set in JavaScript -- l_checkBoxKey := wwv_flow.g_cBoxKey;
However, this does not seem to work because when I replace
l_checkBoxKey := wwv_flow.g_cBoxKey;
with
l_checkBoxKey := 'NOTREQUIRED';
The application process is called and produces results (through the ajax call).
In my view, that the question is how access the "cBoxKey" parameter in the application process.
Any ideas on what could be wrong.
Thank you.
Hello
I check any specification of package APEX version wwv_flow, there is no variable of g_cBoxKey.
If you have idea there?
Change your JavaScript for
var get = new htmldb_Get(null,$v('pFlowId').value,'APPLICATION_PROCESS=TrackRows',0); get.addParam('x01','NOTREQUIRED'); get.get();
And then access process on demand as
l_checkBoxKey := APEX_APPLICATION.g_x01;
Kind regards
Jari -
Show/hide a Div so that the application process will be executed
Hi all
I have the following problem:
I'm on APEX 3 and I have the page with 2 elements. When the user, enter the value in the first element on the page and navigate out of the element, in the second article should be the SYSDATE.
This must be done as:
1. set the fovus in the Item1.
2. navigate off the Item1 (with TAB or the mouse).
3 JavaScript function will be executed:
3.1 icon "Please wait...". "will be displayed.
3.2 application of getDbDate process will be executed.
3.3 the value returned by the getDbDate of application process is allowed in the Field2.
3.4 icon "Please wait...". "disappears.
Here ist the sample application: http://apex.oracle.com/pls/otn/f?p=MISCELLANEOUS:108
In Firefox, I have no problems to show the "Please wait...". "Icon, but the Explorer Intener shows me nothing. But the application process will be executed.
Any ideas?
Best regardsHello
See the example of CARL
http://HTMLDB.Oracle.com/pls/OTN/f?p=11933:62Kind regards
Jari
-----
My Blog: http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0
Twitter: http://www.twitter.com/jariolai -
How to log on automatically to the apex and run a specific page / application
Hi all.
I would like to know if there is a way to connect automatically to the apex and run a specific page / application. I mean, invoke browser and necessary information for you connect (non-public user) and run a specific application (secure ina in if possible).
Thanks in advance...!Hello
Well, as a very crude test, you can set your authentication scheme being request Express authentication define specific users to Apex. Then, create one before the login process of header on the page of connection (101) to automatically open a session that contains:
apex_authentication.login( p_username => :P101_USERNAME, p_password => :P101_PASSWORD ); :P101_PASSWORD := NULL;
conditional on P101_PASSWORD is not null.
Then you can login using your username and password in the URL, for example
f? p = YOURAPP:LOGIN:P101_USERNAME, P101_PASSWORD:username, password
Rod West
-
Application process, do not run after the validation error
Hi all.
APEX 4.1
XE 11 GR 2
WIN7
Firexfox
I have a page where I add additional javascript code to a page by using htp.p in a process of application "before the footer. It works fine as long as there is no validation error. When the validation fails (for example a UK-check with the location of the error value "Inline notification"), the page is re-fondue, but the application process is not running and so my extra code is missing from the page.
Is this intended behavior or am I doing something wrond?
Andreas
Addition:
I tried the sam using a 'local' page process, but these do not seem to fire.
Published by: Andreas Weiden on 22.12.2011 21:31Andreas Weiden says:
Is this intended behavior or am I doing something wrond?
This is the expected behavior. Generally, the process and calculations source item, the actions are not executed when the page is re-made after validation errors. They also provide great potential for confusion of side effects (for example reset to a default value for an item that had an invalid value sent).
However, the engine provides a special treatment for the process with the built-in Inline Validation errors displayed condition so that they will be run when a page is rendered with validation errors. See + {: identifier of the thread = 493070} + for an interesting discussion on this topic.
An alternative (and in my opinion a more classic and rather more clear) would be to generate the JS in a dynamic region of PL/SQL code on the Page zero. Always reuse the code on all or several pages, but is more clearly part of the rendering of the page as an application process and does not rely on a very obscure condition, being the only way you can make it work.
Maybe you are looking for
-
Good charger for MacBook Air?
HI how do I find the right charger for my MacBook Air. It is completely dead and I do not know if it is pre or post 2012 and I have not original documents. Thank you Julie
-
For some banking sites that require passwords, I'm 99.3% sure that I have at one point, never said 'Remember password'. Now, I want to change my mind. When I go to Options/Options/Security/Remember.../Exceptions, the sites are not listed, but I'm not
-
My iMac keeps freezing. How can I solve this problem?
-
Satellite P100 PSPA6A 028017 - screen is blank
My screen goes blank when the Toshiba Manually Nvidia Geforce GO 7900 GS driver active and restarts and just a loop. I am able to use my laptop normally if I just disable the driver and leave it installed. I tried to update the driver, but the proble
-
SUMPRODUCT in any of columns of numbers 3.6.1?
Hi all What I've read, SUMPRODUCT does not work in numbers the way it does in Excel and so will probably have to re - write the formula. Do not know if something has changed in 3.6.1 numbers but here's what I'm looking to replicate: SUMPRODUCT ((A$ 2