Skip to main content

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

  1. 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. 
  2. 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. 
  3. 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
    $NEW:CONTRACT='Shop Order^,${OrderNo}^,${ReleaseNo}^,${SequenceNo}^,${PartNo}^,${Contract}^,${RevisedQtyDue}
    The string is based on custom menu PLSQL logic here. Delimiters can be anything as long as not used in page values. 
  4. 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. 

  5. 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. 

@nithbtns111 Thanks for sharing this idea. We’ve been using the same concept in IFS Cloud upgrade projects and it’s a quite good workaround.

The problem is the complexity and technical scope. It’s technically quite demanding and requires a lot of efforts to get the old pl/sql block to work. The ‘price’ is just too much when the upgrade project includes hundreds of IFS 10 custom menus with PL/SQL.


@AveTonitM Thank you for your comment and suggestions. Yes 100% agree, in IFS Cloud this is quite difficult work. I even investigated workflows to achieve this but with little success. 


Reply