Oracle APEX Show Custom Alert Message Using Page Item Value - oracle-apex

I am trying to create a DA in order to show as an alert the value of my item page P2003_TEMP_DOUBLE.
This value is not stored to any table in my database. The result of this action is a null alert!

Following the javascript api of oracle apex you must apply the bind variables in this way
alert( "P1_ITEM value = " + apex.item( "P1_ITEM" ).getValue() );
Ref. https://docs.oracle.com/database/121/AEAPI/javascript_api.htm#AEAPI29472

Related

Oracle APEX - retrieve default report_id for an IG

I want to retrieve a report_id for the default report for an IG. I tried using apex_application_page_ir_rpt APEX view but there is no data there for that specific application. How can I programmatically find a default report ID?
Best place to start is the view APEX_DICTIONARY. For interactive grid related views, search for any names that have the string 'IG' in them (view with 'IR' reference interactive reports only).
select distinct apex_view_name from apex_dictionary where apex_view_name like '%IG%'
The logical view name that sticks out is APEX_APPLICATION_PAGE_IG_RPTS. The following query will give all available info for a saved report:
select * from APEX_APPL_PAGE_IG_RPTS WHERE page_id = <yourpageid> and application_id = <>yourappid and type = 'PRIMARY';

Is there any way to get the displayed text in the "Select List" without using SQL? (Oracle APEX 21.1)

Anyone help me?
"Select List" (name: P2_SHOPS_LIST) that is created with the following SQL
SQL Statement: SELECT SHOP_NAME, GROUP_ID FROM T_ENTRY_SHOPS WHERE ID=:P2_LOV_ID;
It is necessary "GROUP_ID" because it is PK . But I need edit "SHOP_NAME" value and display to Text Field.
I think I can get the currently displayed SHOP_NAME by combining the above SQL with the selection row number, but is there any way to access this value with No SQL? Like
:P2_SHOPS_LIST.SHOP_NAME
(This gave me an error XD).
In the context of JavaScript, you can use the following
$('#P2_SHOPS_LIST option:selected').text()
This can be passed through to PL/SQL via a dynamic action, such as on change of your select list.
Or you could set your text item on change via a JS based action, using 'Set Value' and that code as the expression.

How can I pass a value from one page so that my "Row text contains" filter is enabled in Oracle APEX

Is there any way in Oracle APEX where we can pass a value from one page to other page, and in the other page it emulates the filter same as "Row text contains".
For eg:
Page A ---> clicks on a link to call Page B and Passes a value '12345' to this new page.
And then
Page B opens up with all the values where row text contains '12345'
I have created a hidden field 'P17812_EMPLOYEE_NUMBER' on page B.
When I click on a link on Page A, I set the value in this field.
Now, I created a dynamic action on "page load" on page B. Where i write the below code :
$("#apexir_SEARCH").val($v("P17812_EMPLOYEE_NUMBER"));
gReport.search("SEARCH");
But this also doesn't work.
Is there any way we can implement this scenario?
Thanks for your help.
You can use IR_ROWFILTER in URL as a parameter and in parameter values the value that you want to filter like:
?p=App:Page:Session:Request:Debug:ClearCache:IR_ROWFILTER:12345:PrinterFriendly
You can read more about APEX url in here https://docs.oracle.com/database/121/HTMDB/concept_url.htm#HTMDB03019
and about IR filter https://docs.oracle.com/database/apex-5.1/HTMDB/linking-to-interactive-reports.htm
Create a hidden page item on page B, have the link set value to the item when you click on it
then have the same select statement from page A on B with a where clause
SELECT a, b, c
FROM test
...
WHERE b = %ITEM%
(THE % tells him that it can be whatever text or no text there)
and dont forget to pass the item to the sql query
I hope I understood what you want, and that my answer is understandable.

Pass column classic report value to PL/SQL

I have page with Classic Report on it (type = PL/SQL Dynamic Content). What I need it's passing one column value to PL/SQL via Dynamic Action when click on another column. It's no problem to initiate click action, but I don't know how to pass equivalent of #col_name# (not :Pxxx_item_name) to PL/SQL.
Application Express 5.0.4.00.12
I'm not sure what you're trying to pass, so I'm just going to call it "item".
In your report add a custom data attribute to the column, data-item="#COL_NAME#". This would go on the image that's getting clicked. You might need to use the HTML Expression option to set this.
Create a hidden item, P1_ITEM and set Value Protected to No.
Create a Dynamic Action that fires when you click the image in the column.
Create a True action on that DA, Action = Set Value, Set Type = Javascript Expression, the JS expression is this.triggeringElement.dataset[ "item" ], Affected Element > Selection Type = Item, Item = P1_ITEM.
Create another True action on that same DA, Action = Execute PL/SQL Code, Items to Submit = P1_ITEM, and whatever code you want in the PL/SQL code section. You can reference P1_ITEM in your code with :P1_ITEM or V('P1_ITEM').
When the DA fires, it will populate the column value into P1_ITEM, then submit that to the server where it's stored in session state, then run your PL/SQL code.

Interactive Grid (IG) ORA-01403 Error in Oracle APEX 5.1.2

How can I overcome this {Ajax call returned server error ORA-01403: no data found for} problem? Problem arises ,When I want to set Order_Status_Field value 2 in IG where query was Order_Status_Id=1.
My IG query was :
SELECT P.ORDER_ID, P.ORDER_STATUS_ID FROM ORDER_DETAILS P WHERE P.ORDER_STATUS_ID=1;
My Workspace Name: ZISHAN
User: ZISHANIIUC#GMAIL.COM
Pass: 123
Problem Page No: 3 (Order Report)
1. Before Updating Order Status:
2. After Updating Order Status:
I saw your are using standard "Interactive Grid - Automatic Row Processing (DML)" process, which is an AJAX approach. this apex behaviour is a call ajax using json format for data. so you have a filter on your sql query
SELECT T.ORDER_ID,
T.TABLE_ID,
T.TAKEN_BY,
T.ORDER_STATUS_ID,
T.TOTAL_COST
FROM ORDER_DETAILS T
WHERE T.ORDER_STATUS_ID=2
and you want to update your filter column (data has change) it's seem like apex do not find the prevouis data filter and return no_data_found (not really sure what happen ) but for solution : .
put your filter in interactive grid --> action button ---> filter
or
write your own custom process
When i tried do alter the process from the "Interactive Grid - Automatic Row Processing (DML)" that apex creats, for my own custom PL/SQL Code i needed to choose one of the columns from the query to be the primary key, and then i could use the pl/sql custom process as found here on this blog:
https://mikesmithers.wordpress.com/2019/07/23/customizing-dml-in-an-apex-interactive-grid/ without the no data found error.