Objective
Uplift a custom menu with PLSQL logic to IFS Cloud
Idea
Use a PLSQL event action and execute the event using a custom command. Only configurations needed for this solution no customizations.
Steps
- Configure the projection adding an action to EVENT_SYS.EVENT_EXECUTE method. Make sure to grant the projection to the end user even though the use has access to the page already for standard pages.
- Create a new custom event and custom event action. Here table can be any table but make sure to untick objects are crated, edited or removed. This event will only be fired calling the EVENT_SYS.EVENT_EXECUTE by calling the Projection bound action. Make sure to include at least one NEW and OLD variable (e.g. :NEW:CONTRACT) value in the event.
- Using the page designer create a custom command of type Action, fill event id, event LU based on the custom event created in step 2. For event data parameter use a string like below
The string is based on custom menu PLSQL logic here. Delimiters can be anything as long as not used in page values.$NEW:CONTRACT='Shop Order^,${OrderNo}^,${ReleaseNo}^,${SequenceNo}^,${PartNo}^,${Contract}^,${RevisedQtyDue}
- Now create a new custom event action for the above event and use below code to get the values from the passed parameter.
DECLARE
type array_t IS varray(15) OF VARCHAR2(1000);
array array_t := array_t();
int_ NUMBER := 0;
CURSOR input_values IS
SELECT REGEXP_SUBSTR('&NEW:CONTRACT', 'R^^,]+', 1, level) AS value
FROM
(SELECT '&NEW:CONTRACT' FROM dual)
CONNECT BY level <= LENGTH('&NEW:CONTRACT') - LENGTH(REPLACE('&NEW:CONTRACT', '^,')) + 1;
BEGIN
-- Shop Order : $NEW:CONTRACT='Shop Order^,${OrderNo}^,${ReleaseNo}^,${SequenceNo}^,${PartNo}^,${Contract}^,${RevisedQtyDue}
FOR rec_ in input_values
LOOP
int_ := int_ + 1;
array.extend();
array(int_) := rec_.value;
END LOOP;Now you have access to all the passed parameter values.
-
In this step other logic of the custom menu can be implemented accordingly utilizing the array values.
Notes
- Once the parameter is passed even sub string operations can be used instead of an array.
- IFS may deprecate event action PLSQL functionality in future so for a completely new development using a workflow may be a better option.
- CHR(30) like values are not supported in IFS Cloud client
@Chamaka Wimalarathne Thanks for the initial idea.