Question

Unique Invoice Identity - spaces

  • 7 November 2022
  • 3 replies
  • 53 views

Userlevel 2
Badge +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

Userlevel 7
Badge +19

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;

 

Userlevel 2
Badge +6

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

Userlevel 4
Badge +9

@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?

Reply