CRUD on VIEW / Send row to form call to action on query mode

CRUD on VIEW :

To add/edit/delete in a V2 FORM, you need two things :

  • Your model has to be a TABLE MODEL
  • Your model require a primary key

A View can be configured has a TABLE, but it will not have primary key, so we will set one.

In order to do this, if you have access to document ‘Form monitoring’, you will have to get the grid item uuid of the FORM.

For this, use the inspector of your navigator (F12) then find the grid-item form and pick its uuid.

You will have to enter it into the input of Form monitoring, find your PRIMARY KEY in the different field and check the case ‘Is Primary Key’ on its row.

If you don’t have access to this report, you can do it with a SQL query :

UPDATE ii_app.p4it_atelier_form_header headers
SET is_primary_key = TRUE 
WHERE grid_item_id = '92eb91a0-ea09-11eb-b967-0242ac130007' -- REPLACE BY YOUR FORM UUID
AND field_name = 'id'

You will now be able to INSERT/UPDATE/DELETE on your FORM. To process the transaction, you will require rules on your VIEW that will accept the data send.

It is possible to link Automation after CRUD on a view, like an usual CRUD in a form.


Send row to form call to action on query mode :

On a form that has a QUERY MODEL, to run action with the values of the current line (use case : an icon [+] to add something to the current entity => you need its ID) you will need a unicity on a column of your query (like primary key).

You will have to go on the configuration of the primary key column, in Control panel, you have to check Is Primary Key (and uncheck Is displayed if you do not want to see it) and save the configuration.

By doing this, when you will call a stored procedure

PERFORM ii_dwh.sp_ii_core_log(p_current_user_name, 10, var_current_object_name, null, p_context_input);

{“row”:{“file_name”:“UnixSSHKeys_NBLIN_1.1.1.1”,“request_running”:false,“id”:“e9a8e0ae-cf67-11eb-a381-0242ac630005”,“fk_batch_status_id”:“e4eb18bc-2048-11eb-a586-0242ac160002”,“fk_batch_id”:“051e838a-cf67-11eb-b7a0-0242ac630005”,“password_style”:“batch-style-green”,“migr_tmp_style”:“batch-style-purple”,“transfer_style”:"",“dlt_style”:""}

1 Like

Wouldn’t it make sense for this to be directly integrated in the UI?