1.
Payables Responsibility > Invoice > Entry >Open Invoice Workbench
Form Menu >Diagnostics >Custom Code> Personalize
Add Description : XX_DUP_INVOICE_INS
Select Trigger Event : PRE-INSERT
Condition:
0<(select count(*) from ap_invoices_all ai where invoice_num =:INV_SUM_FOLDER.INVOICE_NUM and vendor_id
=:INV_SUM_FOLDER.VENDOR_ID
and org_id = :INV_SUM_FOLDER.org_id and UPPER(invoice_type_lookup_code) = UPPER(:INV_SUM_FOLDER.INVOICE_TYPE)
and ((:inv_sum_folder.invoice_id IS NULL) OR :inv_sum_folder.invoice_id <> ai.invoice_id))
Processing Mode: Both
Validate the Query
2.Click on Action Tab
Message Type: Error
Note: Message_Type Error will show error and NOT allow to save Duplicate Invoice Numbers. You can keep Message_type as Show if you want to alert
users but still allow them to save Duplicate Numbers.
Message Text : You have entered duplicate Invoice Number for same Supplier. Please Use Different Invoice Number
Validate the Message
Enable The Personalization
3. Create one more personalization to prevent invoice number update on existing invoice to duplicate number.
Add Description : XX_DUP_INVOICE_UPD
Select Trigger Event : PRE-UPDATE
Condition:
0<(select count(*) from ap_invoices_all ai where invoice_num =:INV_SUM_FOLDER.INVOICE_NUM and vendor_id
=:INV_SUM_FOLDER.VENDOR_ID
and org_id = :INV_SUM_FOLDER.org_id and UPPER(invoice_type_lookup_code) = UPPER(:INV_SUM_FOLDER.INVOICE_TYPE) and
((:inv_sum_folder.invoice_id IS NULL) OR
:inv_sum_folder.invoice_id <> ai.invoice_id))
Processing Mode: Both
Validate the Query
4.Click on Action Tab
Message Type: Error
Note: Message_Type Error will show error and NOT allow to save Duplicate Invoice Numbers. You can keep Message_type as Show if you want to alert
users but still allow them to save Duplicate Numbers.
Message Text : You have entered duplicate Invoice Number for same Supplier. Please Use Different Invoice Number
Validate the Message
Enable The Personalization
5.Verify the Personalization by Entering
Duplicate Numbers