Skip to main content

I’m trying to create a new custom event for Work Order Status Change, that fires an error message if the status is changed from ‘PREPARED’ to “WORKDONE’, that warns the user that they have to first set the status to ‘STARTED’ before changing status to ‘WORKDONE’.

 

Can someone help me out with the SQL code I need to write? The below doesn’t work for me.

 

--

 

DECLARE

CURSOR get IS 

SELECT '&OLD:WO_STATUS_ID'

FROM ACTIVE_SEPARATE_CFT


WHERE 

'&OLD:WO_STATUS_ID' = 'PREPARED'

BEGIN

   IF '&NEW:WO_STATUS_ID' = 'WORKDONE' THEN
         Error_SYS.Appl_General('ERROR!', 'You must set WO status as STARTED before you can select WORK DONE');
   END IF;

END;

Hi @kennethevers

,

I think you can easily configure it via the following approach.

Note: Assumed that the specific WO is in the ‘Active Work Orders’ window.

    1. First create the event (highlighted in yellow)

         Refer attachment 1.
 

  1. Create the action, using the option “Create New Action” in the Event window.

            Refer attachment 2
            Note: Make the Action Enabled; Then only the event too would get enabled.

 

Check whether your requirement is met.

Hope this would help to resolve your issue.
 

Best Regards,

Bhagya

 


Thanks! That was a lot simpler and works great.