Skip to main content
Question

PL/SQL event action

  • June 9, 2026
  • 2 replies
  • 37 views

Forum|alt.badge.img+10
  • Sidekick (Customer)

Hello,

 

I want create event action. When I will create new invoice in customer->invoice through + icon, I want have switch on PrintTaxCodeText on VIEW IDENTITY_INVOICE_INFO and when It will be in false state, it will not create new invoice with error pop up window like “Invoice was not created”.

How should PL/SQL block look like?

Thanks

 

2 replies

ashen_malaka_ranasinghe
Hero (Employee)
Forum|alt.badge.img+14

Hi ​@Ed22,

Here's how the PL/SQL block should look for this event action in IFS Cloud:

DECLARE
print_tax_code_text_ VARCHAR2(5);
invoice_id_ NUMBER;
identity_ VARCHAR2(20);
BEGIN
-- Get the identity from the new invoice being created
-- (adjust parameter name based on your event's available parameters)
identity_ := :IDENTITY; -- or :CUSTOMER_ID depending on event parameters

-- Query the VIEW to check the switch value
BEGIN
SELECT print_tax_code_text
INTO print_tax_code_text_
FROM identity_invoice_info
WHERE identity = identity_;
EXCEPTION
WHEN NO_DATA_FOUND THEN
print_tax_code_text_ := 'FALSE'; -- treat missing record as FALSE
END;

-- If the switch is FALSE, raise an error to block invoice creation
IF NVL(print_tax_code_text_, 'FALSE') = 'FALSE' THEN
Error_SYS.Appl_General(
lu_name_ => 'InvoiceCreation',
msg_name_ => 'INVOICENOTCREATED',
msg_value_ => 'Invoice was not created.'
);
END IF;
END;

Important: Error_SYS.Appl_General raises a standard IFS application error which will surface as a pop-up in the UI with your message text - exactly the behavior you want.


Forum|alt.badge.img+10
  • Author
  • Sidekick (Customer)
  • June 12, 2026

Hello, and in event action what should I add? 

or only new print_tax_code = TRUE?