Hello Sir,
I recently read your blog about creating a row button for an interactive report.
Create Delete Row Button for Interactive Report in Oracle Apex
It is about showing the user all persons who have a similar name to a specified person. This allows the user to decide whether he or she wants to add the new specified user to the database or whether the person is a person who already exists in the system.
When clicking on the Row button, an update should take place and the ID of the selected row should be set in the page element.
I proceeded as in the tutorial:
- added dummy column in interactive report
select (u.LASTNAME||','||u.FIRSTNAME) as Name, u.EMAIL, u.ID,m.ID 'Update' upd from users u right outer join manager on m.ID=u.MID where utl_match.jaro_winkler_similarity(:P8_LASTNAME,u.LASTNAME)>80;
2. Set Properties for the del column
- Type: Link
- Heading: Delete
- Target > Type: URL
- URL:
javascript:void(null);
- Link Text: <span class="t-Icon fa fa-user-check update-irrow" aria-hidden="true"></span>
- Link Attributes:
data-id=#MID#
3 Created a page item to hold pk , key column here is MID
- Name: P8_MID
4.Created Dynamic Action
- Name: UPD_row
- Event: Click
- Selection Type: jQuery Selector
- jQuery Selector: .update-irrow
- Event Scope: Dynamic
5. Created True Actions for DA
- Confirm
- Set Value:
Action: Set Value
Set Type: JavaScript Expression
JavaScript Expression: $(this.triggeringElement).parent().data('mid')
Selection Type: Item(s)
Item(s): P8_MID
- Created another true action :execute pl/sql code
begin update manager set approved=1 where mid=:P8_MID; end;
- Refresh action
Every action works but no value is set for the page element P8_MID.
However, I would like to set this value so that I can continue to use it.
Can you help me with this?
Vinish Kapoor
For the true action execute plsql code are you submitting the page item p8_mid?
I think you are missing that one. Please check the tutorial again.
Ana
Yes I am submitting the item P8_MID, sorry did not mention it
Vinish Kapoor
I don’t see any column in your SQL query with mid alias.
I think you should give alias MID to column u.id? Or you know better.
Ana
afzal
I think , you should use 'id' instead of 'mid' at this below code only.
JavaScript Expression: $(this.triggeringElement).parent().data('mid')
correct-- JavaScript Expression: $(this.triggeringElement).parent().data('id');
Ana
Hello:) thank you for this answer I will try it!:)