Solved

Custom Prompt when closing work order

  • 18 January 2021
  • 1 reply
  • 230 views

Userlevel 4
Badge +7

We would like a warning message to appear, when a user attempts to set a work order to status ‘Finished’ but they have not ticked a custom check box that we have set up.

 

Can anyone point me in the right direction to set something like this up?

icon

Best answer by anmise 18 January 2021, 13:37

View original

This topic has been closed for comments

1 reply

Userlevel 7

You’d have to use an event. A warning will not stop the process, which an error will. Which version of IFS is this for? 
 

Below will produce a warning/info message. There is one called Add_Warning, but that doesn’t work on ActiveSeparate.

Client_SYS.Add_Info('LogicalUnit','TEST: This will be my information message' );

Below will produce a stopping error message.

Error_SYS.Appl_General('LogicalUnit', 'ERROR: This is the error message I want to display');

So, maybe something like this:

DECLARE

CURSOR get IS
SELECT cf$_your_field cf
FROM active_separate_cft
WHERE rowkey = '&NEW:ROWKEY';

BEGIN

FOR rec_ IN get LOOP

IF '&NEW:WO_STATUS_ID' = 'FINISHED' AND NVL(rec_.cf, 'FALSE') = 'TRUE' THEN
Client_SYS.Add_info('ActiveSeparate', 'TEST: Your information message');

END IF;
END LOOP;
END;

DECLARE

CURSOR get IS
SELECT cf$_your_field cf
FROM active_separate_cft
WHERE rowkey = '&NEW:ROWKEY';

BEGIN

FOR rec_ IN get LOOP

IF '&NEW:WO_STATUS_ID' = 'FINISHED' AND NVL(rec_.cf, 'FALSE') = 'TRUE' THEN
Error_SYS.Record_General('ActiveSeparate', 'TEST: Your stopping error message');
END IF;
END LOOP;
END;