How to Use Dynamic Action ?
Dear All,
i am using Apex 4.1 Ver.
i need return value in text Area Item when i select any Value in Select List.
i have One select List Item :p1_template_id and one text Area Item P1_template_description .
Select List Code
SELECT TEMPLATE_NAME D, TEMPLATE_ID R FROM TEMPLATE_MAS ORDER BY TEMPLATE_NAME
Table Name
CREATE TABLE "CRM_CAM_TEMPLATE_MAS"
( "TEMPLATE_ID" VARCHAR2(50) NOT NULL ENABLE,
"TEMPLATE_NAME" VARCHAR2(500) NOT NULL ENABLE,
"DESCRIPTION" CLOB
CONSTRAINT "CRM_CAM_TEMPLATE_MAS_PK" PRIMARY KEY ("TEMPLATE_ID") ENABLE
/i want to Value of DESCRIPTION Column in to Text Area Item when i select Template ID from Select List .
How can i do this with Dynamic Action or any other Way ?
How can i do this ?
Thanks
Vedant
Hi Kiran,
i have done it with Text Area but when i change text Area with Rich Text Editor then it's not Working.
How can i do this with Rich Text Editor.
My Code
Application Process
DECLARE
v_mgr VARCHAR2(4000);
CURSOR cur_c
IS
SELECT DESCRIPTION FROM TEMPLATE_MAS WHERE TEMPLATE_ID =:TEMPLATE_ITEM ;
BEGIN
FOR c IN cur_c
LOOP
v_mgr := c.DESCRIPTION;
END LOOP;
OWA_UTIL.mime_header ('text/xml', FALSE);
HTP.p ('Cache-Control: no-cache');
HTP.p ('Pragma: no-cache');
OWA_UTIL.http_header_close;
HTP.prn ('<body>');
HTP.prn ('<desc>this xml genericly sets multiple items</desc>');
HTP.prn ('<item id="P1_SUMMARY">'||v_mgr|| '</item>');
HTP.prn ('</body>');
EXCEPTION
WHEN OTHERS
THEN
OWA_UTIL.mime_header ('text/xml', FALSE);
HTP.p ('Cache-Control: no-cache');
HTP.p ('Pragma: no-cache');
OWA_UTIL.http_header_close;
HTP.prn ('<body>');
HTP.prn ('<desc>this xml genericly sets multiple items</desc>');
HTP.prn ('<item id="P1_SUMMARY">'||SQLERRM||'</item>');
HTP.prn ('</body>');
END;
Java Script
<script language="JavaScript" type="text/javascript">
<!--
function pull_multi_value(pValue){
var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
'APPLICATION_PROCESS=TEMPLATE_ITEM1',0);
if(pValue){
get.add('TEMPLATE_ITEM',pValue)
}else{
get.add('TEMPLATE_ITEM','null')
gReturn = get.get('XML');
if(gReturn){
var l_Count = gReturn.getElementsByTagName("item").length;
for(var i = 0;i<l_Count;i++){
var l_Opt_Xml = gReturn.getElementsByTagName("item");
var l_ID = l_Opt_Xml.getAttribute('id');
var l_El = html_GetElement(l_ID);
if(l_Opt_Xml.firstChild){
var l_Value = l_Opt_Xml.firstChild.nodeValue;
}else{
var l_Value = '';
if(l_El){
if(l_El.tagName == 'INPUT'){
l_El.value = l_Value;
}else if(l_El.tagName == 'SPAN' &&
l_El.className == 'grabber'){
l_El.parentNode.innerHTML = l_Value;
l_El.parentNode.id = l_ID;
}else{
l_El.innerHTML = l_Value;
get = null;
//-->
</script>
HTML Form Element Attributes
onChange="pull_multi_value(this.value)";
For Riich Text Editor i have changed these value in Application Process and table column data Type
v_mgr clob;
DESCRIPTION Column Type Clob
How can i do this with Rich text Editor /
Thanks
Similar Messages
-
How to use dynamic action to fill multi item on a page ?
Hi..
I want to fill multi items on a page so I build a dynamic action ( Execute PL/SQL Code ) to do it .The problem is that when the page loads I can't see any data and I tried to see the session values using debug and I found data. Moreover when I save the row I got these data saved.
So what is the magic there?
ThanksFirstly, to get the multi-select populated with "pre-selected" values the easiest approach is to use Computation or Process at a process point On Load Before Header or After Header or Before Regions.
All you need to do is populate your "Select List " page Item with : (colon) separated list of selected values. E.g is you want A,B and C out of A,B,C,D,E selected then get A:B:C into the Page Item.
If you have used Dynamic Actions, what is your event on which the action fires? For Dynamic-Actions the page (HTML DOM) needs to be existing , so it must fire after the page has loaded.
Regards, -
How to make a default value by using dynamic actions
Hi,
I want to default a field nationality in infotype 0002 as a great britan, using dynamic actions but unable to go ahead. Any help regarding this really appreciate.
Regards
NiranjanHi,
I need some guidance around creating dynamic action with default value, Please guide me through.
I am aware I can set default values for new infotype, but I need to set default value for same infotype, let me explain the scenario.
Currently employee is on one pension scheme which is called NE1 and now we are moving this employee to CRESP Pension Scheme.
When employee is in NE1, his IT0071 has got a opt in field with a flag on, when the same employee is moved from NE1 pension scheme to CRESP Pension scheme, his new IT0071 record should have the same opt in field with a flag on, I want it to set this flag automatically using dynamic action. I dont want to update this field manually, while moving from NE1 to CRESP.
Currently the below dynamic action is coded when employees are being moved form NE1 to CRESP, but now they will have a opt in flag which should appear automatically, What needs to be done to make this happen?
Please let me know if I set default value for the Opt in field for the same infotype.
. When employees are being moved from NE1 to CRESP pension scheme we currently use a dynamic action as show below:
0071 04 10 I INS,0069
0071 04 20 W P0069-BEGDA=P0071-BEGDA
0071 04 30 W P0069-ENDDA=P0071-ENDDA
0071 06 1 F DYNACT_PAE031(ZHRPROG016)
Also if it is not possible via dynamic action could you please explain how to create it using user exit, I am not an ABAPer.
Your help is very much appreciated.
Kind Regards,
SK -
About creating an AJAX page with DML procedures using dynamic actions
About creating an AJAX page with DML procedures in APEX using dynamic actions. Help with limitations.
I want to share my experience, creating AJAX procedures in APEX 4.0.
LIMITATIONS
• How Can I Hide UPDATE button while I press NEW button. ??
• How Can I Hide CREATE button while I’m UPDATING A RECORD. ??
• How can I avoid multiple Inserts or Updates. ??
Here are the steps to create an AJAX Updatable Form using the sample table DEPTS. You can see the demo here: [http://apex.oracle.com/pls/apex/f?p=15488:1]
1) Create a blank page
2) Add a Report Region for departments (It shows the columns deptno, dname and loc).
3) Add an HTML Region and create the elements to edit a Department.
a. P1_DEPTNO (Hidden to store PK)
b. P1_DNAME (Text Field)
c. P1_LOC (Text Field)
4) You also have to create a hidden element called P1_ACTION. This will help to trigger dynamic actions to perform DMLs.
5) Open Page Attributes and in the HTML Header Section include the following code.
<script>
function doSelect(pId){
$x_Value(‘P1_DEPTNO’,pId);
$x_Value(‘P1_ACTION’,’SELECT’);
</script>
6) Modify the column DEPTNO in the report, to add column link. In the link text you can use #DEPTNO# , in target you must select ‘URL ‘ and in the URL field write javascript:doSelect(#DEPTNO#);
7) Create the following Buttons in the Form Region.
CANCEL Redirects to URL: javascript:$x_Value(‘P150_ACTION’,’CANCEL’);
NEW Redirects to URL: javascript:$x_Value(‘P150_ACTION’,’NEW’);
SAVE Redirects to URL: javascript:$x_Value(‘P150_ACTION’,’UPDATE’);
CREATE Redirects to URL: javascript:$x_Value(‘P150_ACTION’,’CREATE’);
8) Create the following Dynamic Action to Select a Department
Name: Select Dept
Event: Change
Selection Type: Item(s)
Item(s): P1_ACTION
Condition: equal to
Value: SELECT
Action: Execute PL/SQL Code
PL/SQL Code:
SELECT dname, loc
INTO :P1_DNAME, :P1_LOC
FROM dept
WHERE deptno = :P1_DEPTNO;
Page Items to Submit: P1_DEPTNO, P1_DNAME, P1_LOC
Don’t include any false action and create the Dynamic Action.
The first limitation, the value of page elements don’t do refresh so I added the following true actions to the dynamic action AFTER Execute PL/SQL Code.
Action: Set Value
Unmark *‘Fire on page load’* and *‘Stop execution on error’*
Set Type: PL/SQL Expression
PL/SQL Expression: :P1_DNAME
Page Items to submit: (none) (leave it blank)
Affected Elements: Item P1_DNAME
Action: Set Value
Unmark *‘Fire on page load’* and *‘Stop execution on error’*
Set Type: PL/SQL Expression
PL/SQL Expression: :P1_LOC
Page Items to submit: (none) (leave it blank)
Affected Elements: Item P1_LOC
These actions allow refresh the items display value.
9) Create the following Dynamic Action to Update a Department
Name: Update Dept
Event: Change
Selection Type: Item(s)
Item(s): P1_ACTION
Condition: equal to
Value: CREATE
Action: Execute PL/SQL Code
PL/SQL Code:
UPDATE dept SET
dname = :P1_DNAME,
loc = :P1_LOC
WHERE deptno = :P1_DEPTNO;
Page Items to Submit: P1_DEPTNO, P1_DNAME, P1_LOC
Don’t include any false action and create the Dynamic Action.
Include the following True Actions BEFORE the Execute PL/SQL Code true Action.
Action: Set Value
Unmark ‘Fire on page load’ and ‘Stop execution on error’
Set Type: PL/SQL Expression
PL/SQL Expression: :P1_DNAME
Page Items to submit: P1_DNAME
Affected Elements: Item P1_DNAME
Action: Set Value
Unmark *‘Fire on page load’* and *‘Stop execution on error’*
Set Type: PL/SQL Expression
PL/SQL Expression: :P1_LOC
Page Items to submit: P1_LOC
Affected Elements: Item P1_LOC
These actions allow refresh the items display value.
Finally to refresh the Departments report, add the following true action at the end
Action: Refresh
Affected Elements: Region Departments
10) Create the following Dynamic Action to Create a Department
Name: Create Dept
Event: Change
Selection Type: Item(s)
Item(s): P1_ACTION
Condition: equal to
Value: CREATE
Action: Execute PL/SQL Code
PL/SQL Code:
INSERT INTO dept(deptno,dname,loc)
VALUES (:P1_DEPTNO,:P1_DNAME,:P1_LOC);
Page Items to Submit: P1_DEPTNO, P1_DNAME, P1_LOC
Don’t include any false action and create the Dynamic Action.
Include the following True Actions BEFORE the Execute PL/SQL Code true Action.
Action: Set Value
Unmark *‘Fire on page load’* and *‘Stop execution on error’*
Set Type: PL/SQL Function Body
PL/SQL Function Body:
DECLARE
v_pk NUMBER;
BEGIN
SELECT DEPT_SEQ.nextval INTO v_pk FROM DUAL;; -- or any other existing sequence
RETURN v_pk;
END;
Page Items to submit: P1_DEPTNO
Affected Elements: Item P1_DEPTNO
Action: Set Value
Unmark *‘Fire on page load’* and *‘Stop execution on error’*
Set Type: PL/SQL Expression
PL/SQL Expression: :P1_DNAME
Page Items to submit: P1_DNAME
Affected Elements: Item P1_DNAME
Action: Set Value
Unmark ‘Fire on page load’ and ‘Stop execution on error’
Set Type: PL/SQL Expression
PL/SQL Expression: :P1_LOC
Page Items to submit: P1_LOC
Affected Elements: Item P1_LOC
These actions allow refresh the items display value.
Finally to refresh the Departments report, add the following true action at the end
Action: Refresh
Affected Elements: Region Departments
11) Create the following Dynamic Action to delete a department
Name: Delete Dept
Event: Change
Selection Type: Item(s)
Item(s): P1_ACTION
Condition: equal to
Value: DELETE
Action: Execute PL/SQL Code
PL/SQL Code:
DELETE dept
WHERE deptno = :P1_DEPTNO;
Page Items to Submit: P1_DEPTNO
Don’t include any false action and create the Dynamic Action.
Include the following True Actions AFTER the Execute PL/SQL Code true Action.
Action: Refresh
Affected Elements: Region Departments
Action: Clear
Unmark ‘Fire on page load’
Affected Elements: Items P1_DEPTNO, P1_DNAME, P1_LOC
12) Finally Create the following Dynamic Action for the NEW event
Name: New Dept
Event: Change
Selection Type: Item(s)
Item(s): P1_ACTION
Condition: equal to
Value: NEW
Action: Clear
Unmark *‘Fire on page load’*
Affected Elements: Items P1_DEPTNO, P1_DNAME, P1_LOCI need some help to solve this issues
• How Can I Hide UPDATE button while I press NEW button. ??
• How Can I Hide CREATE button while I’m UPDATING A RECORD. ??
• How can I avoid multiple Inserts or Updates. ?? -
Sending mail of infotype record using dynamic actions
Hi
How can we send mail of info type record using dynamic actions if possible give me one example
Mail to me: [email protected]
Thanks & Regards
santhosh reddyHi..
Already Standard Entries exists for the same.. pls check T588Z -
Sending mails using dynamic actions
Hi
How we can send mails using dynamic actions.
Regards
SanthoshHi,
Sending mails is possible by using the feature M0001. This is to be coded in the dynamic action depending on the requirement with function code "M".
Hope this would help you to explore further. Incase of any specific query you can post back.
Regards
Tharak -
Send mail using Dynamic actions
Hello experts,
How to send a mail using Dynamic Actions??
Requirement : Lets say one employee is hired on 26th Aug, so after 10 days he will be confirmed. so on 8th day need to send a mail to concerned person reminding the confirmation date.
so how do i do that using dynamic actions??
Thanks in advance.
SaurabhHi,
In dynamic actions there is an option for calling sub-routine from any program or subroutine pool. So u can make subroutine for sending mail according to ur requirement. An call on th same from dynamic actions.
if u want sample code for this, pls let me know.
<removed_by_moderator>
Regards,
Ranjith
Edited by: Julius Bussche on Aug 26, 2008 3:25 PM -
Can anybody please send me a small program on How to Use Dynamic SQL.
How to execute and run give details.
Thanks
nullYou can certainly use the INTO (and USING) clauses of EXECUTE IMMEDIATE to pass in and return data, i.e.
EXECUTE IMMEDIATE sqlStmt
USING variable1, variable2
INTO output1, output2The more complex the statement, however, the more appropriate DBMS_SQL is. DBMS_SQL also has the potential to allow you to use bind variables rather than reparsing the statement many times.
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC -
How to use same actions for differ pop-up
Hi gurus,
I am using 2 popup in a view.same popup's having same buttons 'Yes', 'No'.when i use 1st one i have to create an action for that Yes button where i put my code for that particular Action.
But when i used 2nd one the action define for that is not acceptable with differ name.it takes only standard one.
Now my Query is : How to use same actions for differ pop-up buttons with in a similar view?Where i put my code.
Plz sugges me.
<b>Points will be sured.</b>
Sanket sethiHi,
Take one integer value attribute in the context of view
when you r performing action on POP1 set it's value to 1
when you r performing action on POP2 set it's value to 2
create one method which receives integer argument, say diaplay(int a)
In the action call display(wdContext.currentContextElement().get<intvariable>()) by passing the value in the context attribute
in display() method, Check the value of integer variable..
if it is 1 then perform action related to POP1
if it is 2 then perform action related to POP2
Regards
LakshmiNarayana -
How to use same actions for differ pop-up buttons
Hi gurus,
I am using 2 popup in a view.same popup's having same buttons 'Yes', 'No'.when i use 1st one i have to create an action for that Yes button where i put my code for that particular Action.
But when i used 2nd one the action define for that is not acceptable with differ name.it takes only standard one.
Now my Query is : How to use same actions for differ pop-up buttons with in a similar view?Where i put my code.
Plz sugges me.
<b>Points will be sured.</b>
Sanket sethiHi ,
u can use the method SUBSCRIBE_TO_BUTTON_EVENT of the IF_WD_WINDOW interface ... to handle the event fired by the popup .....used this method after creating the popup window ...
regards
Yash -
Is it possible to change LOV definition using dynamic action?
Hi,
I have a multi-select LOV page item, P27_MULTI_CLASS_CODE, defined as below. On page load, this list only contains values based on what has been passed to P27_OLO_CODE or P27_OLO_CODE_SW.
SELECT DISTINCT c.class_code d, c.class_code r
FROM ORGANIZATION o,
POSITION p,
CLASS c
WHERE o.org_wk = p.org_wk
AND p.class_wk = c.class_wk
AND o.org_active_flag = 'Y'
AND p.pos_active_flag = 'Y'
AND c.class_active_flag = 'Y'
AND (o.olo_code = :P27_OLO_CODE
OR o.olo_code = :P27_OLO_CODE_SW)
ORDER BY c.class_code ASC
Before submitting the page, I would like the LOV definition of P27_MULTI_CLASS_CODE to change to the following (similar query without reference to P27_OLO_CODE or P27_OLO_CODE_SW) based on whether the user selects checkbox item, P27_ALLOW_SW. By doing this, P27_MULTI_CLASS_CODE would contain a full range of values rather than limited values.
SELECT DISTINCT c.class_code d, c.class_code r
FROM ORGANIZATION o,
POSITION p,
CLASS c
WHERE o.org_wk = p.org_wk
AND p.class_wk = c.class_wk
AND o.org_active_flag = 'Y'
AND p.pos_active_flag = 'Y'
AND c.class_active_flag = 'Y'
ORDER BY c.class_code ASC
I wanted to avoid writing Javascript. Is this possible using dynamic actions...or at least somehow refresh P27_MULTI_CLASS_CODE so that it ignores P27_OLO_CODE and P27_OLO_CODE_SW?
I've tried creating a dynamic action to clear the value of P27_OLO_CODE or P27_OLO_CODE_SW, in hope it would trigger P27_MULTI_CLASS_CODE to display all values, but it has not been successful. Any ideas?
APEX 4.2I was able to resolve by changing the SQL statement to P27_MULTI_CLASS_CODE. Note: I also included an additional condition.
SELECT DISTINCT c.class_code d, c.class_code r
FROM ORGANIZATION o,
POSITION p,
CLASS c
WHERE o.org_wk = p.org_wk
AND p.class_wk = c.class_wk
AND o.org_active_flag = 'Y'
AND p.pos_active_flag = 'Y'
AND c.class_active_flag = 'Y'
AND (:P27_ALLOW_SW = 'Y'
OR (o.olo_code = :P27_OLO_CODE
OR o.olo_code = :P27_OLO_CODE_SW)
AND (:P27_PAY_PLAN IS NULL
OR p.pay_plan = :P27_PAY_PLAN)
ORDER BY c.class_code ASC
I also changed the Cascading LOV Parent Item(s) value to: P27_OLO_CODE,P27_OLO_CODE_SW,P27_PAY_PLAN,P27_ALLOW_SW. Optimize Refresh = No, since a change in any one of these values should trigger refresh of LOV.
The Dynamic Action was also modified to NULL out P27_OLO_CODE,P27_OLO_CODE_SW when P27_ALLOW_SW was enabled.
So far, so good! Thanks for your suggestions Tom and Howard! -
How to include dynamic action in bdc
Hi All,
I want to update infotype 17 when an employee has joined through PA40 (Joining action).So i have written a dynamic action for this .But this dynamic ation does not get called in bdc for joining action.
So infotype 17 is not maintained if we do joining through bdc.
I have tried with user-exit zxpadu02 also, calling hr_infotype_operation on saving infotype 0001.But it gives return as 'Employee does not exist'.
Since that infotype 0001 is still not saved.
So what to do.
YogeshHi Amit,
For your information we can call dynamic action from BDC.
go through this link
how to include dynamic actions in bdc -
How to use dynamic select query which queries from 3 different table.
Hi All,
I am new to Toplink, i would like to use a named query to select some of the columns from 3 different tables with dynamic where clause.
I have used the following lines. Please tell me how to get code for the dynamic where clause.
First try :
Vector objPersons = (Vector)session.executeQuery("findPersonByGlobalID",Person.class,vQueryArguments);
The above method is not returning the vector or collection.
Second Try:
ReadAllQuery query = new ReadAllQuery(Person.class);
query.useCollectionClass(LinkedList.class);
LinkedList person = (LinkedList) session.executeQuery(query);
The second try is returning the collection but, this fetches all the record from the table.
1. How to query for range of records?
2. How to query from multiple tables for some range. How to use dynamic range values ?
Please reply with your answers or some pointers would help.
Thanks and Regards,
Vijay.BHi,
Did you try using a SQLCall ? It might be able to satisfy you requirements .. :-
Employee employee = (Employee) session.executeSelectingCall(
new SQLCall("SELECT * FROM EMPLOYEE WHERE EMP_ID = 44")
);You can get more information here :-
http://www.oracle.com/technology/products/ias/toplink/doc/1013/MAIN/_html/qrybas004.htm
Regards,
Sandeep -
How to use dynamic list box in survey builder?
Hello,
Could someone give me a little bit of thread? How to use dynamic list box in survey builder?Hi Liu,
Dynamic combo boxes::A combo box is dynamic if it references a document property for which a value set is defined in the configuration (System Administration ® System Configuration ® Content Management ® Global Services ® Property Metadata ® Properties ® Parameter Allowed Values).
At runtime (when you open the creation form) the system reads these values from the configuration and displays them in the dropdown list.
If you link a combo box for which list entries already exist to a document property with a value set, the system asks whether you want to delete the list entries. it is recommend that you accept this suggestion and delete the list entries from the XML Forms Builder. Otherwise inconsistencies could arise between the entries in the XML Forms Builder and the value set in the configuration. This can cause errors when saving.
Also you may Refer the Link for Further help:
http://help.sap.com/saphelp_crm50/helpdata/en/29/c40d3d2a83752de10000000a114084/frameset.htm
http://help.sap.com/saphelp_crm50/helpdata/en/00/9e7f41969e1809e10000000a155106/frameset.htm
http://help.sap.com/saphelp_crm50/helpdata/en/a7/5a874174a8050de10000000a1550b0/frameset.htm
Hope it Answers your Queries..
Thanks and Regards,
RK. -
Why we are using dynamic actions in HR
why we are using dynamic actions in HR?? main purpose of it>>
Check the link -
Re: Dynamic Actions
Re: dynamic actions
Re: Dynamic Actions
www.hrexpertonline.com/downloads/Rehan%20Zaidi%20Online%20Portion.doc
Regards,
Amit
Reward all helpful replies.
Maybe you are looking for
-
Sap standard report for showing line items of any GL with its offsettinga/c
Dear all, Is there any standard report in SAP to show line items of GL with its offsetting accounts. in short i want to see all journal entries of one specific GL account.could any of you help me in this? points will be rewarded for the relevant answ
-
Login Hook stops working once I've changed the username
Hello. I need to change the usernames for a number of local accounts on a 10.5.8 mac. The accounts were set up by someone else who is no longer working at this education insitution and hasn't left any documentation. Currently when each user logs on,
-
Is there a way to block all internet on my teenagers IPhone4s?
I would like to block internet usage on my teenagers IPhone4S during select times. Is there a way to do this?
-
iTunes accepted my de-authorize request but didn't reset. Now when I check it it says I have to wait till June 26th? There has to b a way to reset this! I can't wait to access my Cloud svcs etc for 2 months!
-
Ukrainian text on preview is fine but gives junk char on print in smartform
HI All, I am trying to print hardcoded ukrainian text in smartform. In preview it is coming correctly but while printing it gives some junk charecters. During my analysis i found out that previously existing hardcoded text is coming fine on printing