Skip to main content
Question

Unique Invoice Identity - spaces

  • November 7, 2022
  • 3 replies
  • 71 views

jaryskorys
Sidekick (Customer)
Forum|alt.badge.img+6

Hi All. We have problem assuring invoices being entered only once in the IFS Financials. The Invoice identity is validated to be unique, but that does not work if spaces are typed by mistake at the end or the beginning of the field. Any good idea or practice to suppress the leading/Trailing spaces in the IFS fields upon entry?

3 replies

Forum|alt.badge.img+21
  • Superhero (Employee)
  • November 7, 2022

If you can’t find and fix the source where it is possible to enter those leading/trailing spaces you can create a custom event to prevent the invoice from being created.

Example, if it is the invoice number that is the problem:

BEGIN
IF '&NEW:INVOICE_NO' != ltrim('&NEW:INVOICE_NO') THEN
Error_SYS.Record_General('Dummy','SPACECHECK: Invoice number "&NEW:INVOICE_NO" contains leading space(s) and that is not allowed.');
ELSIF '&NEW:INVOICE_NO' != rtrim('&NEW:INVOICE_NO') THEN
Error_SYS.Record_General('Dummy','SPACECHECK: Invoice number "&NEW:INVOICE_NO" contains trailing space(s) and that is not allowed.');
END IF;
END;

 


jaryskorys
Sidekick (Customer)
Forum|alt.badge.img+6
  • Author
  • Sidekick (Customer)
  • November 7, 2022

Hi Tomas. Thanks a lot for the hint. We will try!


Forum|alt.badge.img+10
  • Hero (Customer)
  • December 21, 2022

@Tomas Ruderfelt I configured using the above SQL and it works in EE but when I try in Aurena I do not receive the described error message. Instead I get a generic “System Error” message. How can I have the text show up?