2

I have a validation that throws a PXException in an action, and the message has an email address. Something strange is occurring where the email is not printed in full in the message.

For example, it is showing "The following email is already in use: myemail" instead of "The following email is already in use: myemail@email.com" i.e. it removes the part of the email after the @ symbol.

I am using this approach to throw the error:

throw new PXException(EDMessages.REGISTRATION_EMAIL_ALREADY_INUSE, row.Email);

Is this standard Acumatica behavior? As a workaround, I can try to use Ask rather than PXException, but it would be good to know why this is happening.

ESCoder
  • 15,431
  • 2
  • 19
  • 42
Joseph Caruana
  • 2,241
  • 3
  • 31
  • 48
  • 2
    Interesting. I found that I can reproduce this, but the full email address displays in the trace that accompanies PXException even though the presentation layer seems to cut off the resulting string starting with the @. – Brian Stevens Jun 26 '20 at 20:26

1 Answers1

2

There's strong indication that Acumatica uses that character for routing exception message to a specific HTML frame. Internal format goes like that: '$target=frame_name@message'.

I suspect this JavaScript snippet from Acumatica framework is causing the issue:

// extraction of redirect message
var ar = result.split('@', 2), msg = ar.length > 1 ? ar[1] : null;
result = ar[0];
Hugues Beauséjour
  • 8,067
  • 1
  • 9
  • 22