Skip to main content
Solved

PO Custom Event before PO Auth required

  • September 15, 2023
  • 4 replies
  • 92 views

Forum|alt.badge.img+10

I am trying to enable a custom event on the PO to verify if there is an attachment before it it sent for Authorization. I am using the PO Status as the trigger but the alert will only come after the Authorization step. Any suggestions? Thanks

Best answer by mmoss

I switched the Table and was able to get to the approval tab. 

4 replies

Forum|alt.badge.img+10
  • Author
  • Hero (Customer)
  • Answer
  • September 15, 2023

I switched the Table and was able to get to the approval tab. 


Harsha Siriwardhana
Hero (Former Employee)
Forum|alt.badge.img+8

Hi ​@mmoss 

Could you please explain how you created that custom event?

We’re currently trying to configure a custom event that verifies whether a charge has been added to the PO before it is sent for authorization.

 

Best regards,
Harsha


Forum|alt.badge.img+10
  • Author
  • Hero (Customer)
  • April 24, 2025

@Harsha Siriwardhana. I Created an even to trigger before a new entry was made in the purchase order approval tab table.  Then I checked for any records in the documents table. You can update the documents to check for a charge instead.

LU: Purchase Order

Table: PURCHASE_ORDER_APPROVAL_TAB.

Execute online SQL

DECLARE  

Lcount NUMBER;

PRAGMA AUTONOMOUS_TRANSACTION;

BEGIN

SELECT
Count(POL.order_no) ord into Lcount
FROM PURCHASE_ORDER_LINE_ALL POL
LEFT JOIN PURCHASE_ORDER PO ON PO.ORDER_NO=POL.ORDER_NO
LEFT JOIN  DOC_REFERENCE_OBJECT D ON REPLACE(D.KEY_VALUE,'^','') = PO.ORDER_NO  
WHERE 
PO.ORDER_NO =  '&NEW:ORDER_NO' 
AND D.DOC_CLASS IS NULL
AND POL.STATE IN ('Planned','Released');

IF LCOUNT > 0
THEN 
IFSAPP.ERROR_SYS.RECORD_GENERAL('Missing Attachment',':Please attach supplier supporting document (Email, Quotation, SOW).');
END IF;
END;


Harsha Siriwardhana
Hero (Former Employee)
Forum|alt.badge.img+8

Hi ​@mmoss 

Thank you for your response. I will try this and get back to you if I need further assistance.

 

Best regards,

Harsha