I have a page on my app that allows the user to create (insert) a new row on my table:
Employee Manager id Status
john ryan 1 Active
angela ryan 2 Active
steve jim 3 Inactive
Id column acting as primary key.
My Interactive Grid is working ok for updates, the 'add row' button works (a new row is displayed and info can be added into it). But when clicking on save, this 'new row added' disappears, info doesn't get inserted into the table at all.
My query as follows:
select
--PK
id,
Manager,
Employee,
--Update only available when Status is active:
decode(Status,'Active', 'U',
'X') as Editable
from my_table
IG attributes:
Edit = enabled
Allowed Operations = update row, add row
Allowed Row Operations Column = Editable
Lost Update Type = row value
Add row if empty = Yes
Anybody has any idea why?
Thank you all
Related
I have a dropdown to select no. of rows displayed in dash.datatable (eg. 4 rows default)
But when changed row no. is changed in dropdown my table values are gone.
I want them unchanged when increase the row value. can someone help me on this.
Callback used to fetch the row in datatable is here
#app.callback(
Output('data_table','data'), Input('dropdown','value'),
)
def table(rows):
if rows is not None:
return dbdata.head(rows).to_dict('records')
I don't want to include any button to add new row, just when the dropwdown is changed I want the table value to remain unchanged.
I would like to update all rows inside one column. Each column would have its own input which will update the rest of the rows. Currently I have an existing edit batch table. I was wondeing if it was possible to:
select a column (maybe with checkbox)
Row 1 is empty, however will trigger a function
This function takes the input value (which the user will type) of row 1 cell and populate this value for every row inside the that column.
COL 1 || COL 2
row 1 || row 1
row Z || row Z
After this the user should still be able to activate the cancel button and the original data appears back in the table. The table data should not be saved unless the saved button is pressed.
I've tried a fucntion using a button where we would execute row.set(column, value), however this would refresh the grid table and the original data would reappear.
I'm working with an Interactive Grid, while updating a value I get success message but nothing really happens (I update the value, click on save, message pop-up appears: changes saved. But the values remain the same).
This is my query:
select
PRODUCT_SECTION,
PRODUCT_ID,
PRODUCT_NAME,
MIN_QUANTITY,
QUANTITY, --This is the column available for updates
MY_PRIMARY_KEY
FROM MY_TABLE
WHERE USER = lower(v('APP_USER'))
AND ID = :P31_MY_ID
AND DEAL_ID = nvl(:P31_MY_DEAL, 'No Deal')
Can anyone help me please?
Thanks!
I want to access extra page item value from a trigger which isn't in the related data table. For an example I have a table like below,
Employee
----------------------
empId | fName | lName
----------------------
1 | John | Doe
----------------------
2 | Jane | Doe
Apex form items will be like,
P500_EMPID, P500_FNAME, P500_LNAME
I have an extra page item called P500_SOMEIDSwhich is a multi select list. I want to access those selected values inside After Insert trigger of the Employee table. I tried to add this item into "Page Items to Submit". But I do not know how to access it inside that trigger. Is it possible..? and How..?
In the page process that handles your table update (that will be a process of type "Form - Automatic Row Processing (DML)", under "Settings" there is a attribute "Return Primary Key(s) after Insert". If that is set to "On", then the insert statement will return the value of the inserted row into the page item that is defined as your primary key.
Example:
Create a form on emp
Make P1_EMPNO the primary key page item
Suppose you create a new row, and that empno value is 1000. Then after the automatic row processing page process is run, the value of P1_EMPNO is set to 1000.
If you want to insert rows into another table referencing the newly created empno then you can create a page process (that executes after the row processing) of type pl/sql code like this:
BEGIN
INSERT INTO some_other_table (empno) VALUES (:P1_EMPNO);
END;
Using triggers for business functionality should be avoided whenever possible.
Instead of a database trigger, use a stored procedure which will do the same job. Pass any number of parameters you want (including the P500_SOMEIDS item).
Which trigger to use - Statement or Row level?
If I use row level trigger , how to restrict it to insert data in tracking table only once for a group of entries in VALUES table
Database Schema -
ITEM_VERSIONS TABLE - Item_id,Version id,start_version_id,end_version_id
ITEM_VALUES_TABLE- Value Id, Value, Item_id, Start_version , End Version
Each time an item is created :
ITEM_VERSIONS TABLE - This table stores all the information of Item Versions.
For 1 item version, it has 1 row.
ITEM_VALUES_TABLE - This has all the values info .
So for 1 item , this table has 15-20 rows for each value attribute. Lets say Item_date , color etc
I want to create a trigger on ITEM_VALUES_TABLE and insert the version id in the tracking table.
To get version id, I have to use ITEM_VERSIONS TABLE to get the version id of the item and then update in the tracking table