Skip to main content
Solved

Report rule to email recipient

  • Jan 7, 2025 3:23 PM UTC
  • 11 replies
  • 304 views

Forum|alt.badge.img+10

Hi,

 

Is there a way to set the to email person to be either the supplier email or the user email.

 

For example - the PURCHASE_ORDER_PRINT_REP, trying to do something like the following:

 

Best answer by KIMKIMANDREW

Just to confirm, here is a working example from my test system...

 

The SQL text is this

[&select coalesce(<sq>[@PURCHASE_ORDER_PRINT_REP/PO_HEADERS/PO_HEADER/SUPPLIER_EMAIL]<sq>,<sq>[#Email]<sq>) from dual]

All of the <sq> ‘s are single quote characters

Line 30 in the above screen shot sends me an e-mail with both the input fields for checking…

 

 

View original

11 replies

Marcel.Ausan
Ultimate Hero (Partner)
Forum|alt.badge.img+22
  • Ultimate Hero (Partner)
  • Jan 7, 2025 3:42 PM UTC

​@JannetteC I guess this might work only when there’s a user email populated in the Print Preview window. Have you tested this? Are you getting any errors?


Forum|alt.badge.img+10
  • Author
  • Hero (Customer)
  • Jan 10, 2025 9:02 AM UTC

​@Marcel.Ausan 

I get an error in the app messages, the email address has the coalesce in it causing the issue.  Is there a way to get around this - shown below

 

 


Forum|alt.badge.img+10
  • Author
  • Hero (Customer)
  • Jan 21, 2025 11:15 AM UTC

Hi Community,

I have set the following in a report rule but on checking in the log it is always evaluated as FALSE.

 

Is this valid syntax, what I am trying to do is say if the email address has the info in expression 2 then continue.

 

 


Forum|alt.badge.img+10
  • Hero (Customer)
  • Jan 21, 2025 12:02 PM UTC

I suspect you will need to embed a SELECT FROM DUAL statement.

[&select COALESCE (‘[@PURCHASE_ORDER_PRINT_REP/PO_HEADERS/PO_HEADER/SUPPLIER_EMAIL]’,’[#Email]’) 

from DUAL;]

Something along these lines for the email property

 


Forum|alt.badge.img+10
  • Author
  • Hero (Customer)
  • Jan 21, 2025 12:43 PM UTC

Hi ​@KIMKIMANDREW ,

I changed the expression to the following  :

The error message in the log file is this :

 

Rule ID=10 ORA-911:ERROR Evaluating Expression=''[&select CASE When Len('jannette.christie@theclancygroup.co.uk')=0 Then  ‘income.team@westsussex.gov.uk’ Else ’jannette.christie@theclancygroup.co.uk’ End from DUAL%3D]'' result_key=491559formatter_properties=LocaleCountry­GB

 

Any ideas ?


Forum|alt.badge.img+10
  • Hero (Customer)
  • Jan 21, 2025 3:23 PM UTC

Check the use of (the right) quotes  ‘ vs `


Forum|alt.badge.img+10
  • Author
  • Hero (Customer)
  • Jan 21, 2025 3:40 PM UTC

Hi ​@KIMKIMANDREW 

When I look at the app messages this is what I see ??

 

 


Forum|alt.badge.img+10
  • Hero (Customer)
  • Jan 21, 2025 3:54 PM UTC

I think copy and paste from the community converts single quotes to apostrophes. And this means the code doesn't work.  Try manually typing the code and use single quotes


Forum|alt.badge.img+10
  • Author
  • Hero (Customer)
  • Jan 22, 2025 9:27 AM UTC

Hi ​@KIMKIMANDREW 

I have typed it all in manually but still getting the same error in the app message.

Thanks


Forum|alt.badge.img+10
  • Hero (Customer)
  • Answer
  • Jan 23, 2025 8:26 AM UTC

Just to confirm, here is a working example from my test system...

 

The SQL text is this

[&select coalesce(<sq>[@PURCHASE_ORDER_PRINT_REP/PO_HEADERS/PO_HEADER/SUPPLIER_EMAIL]<sq>,<sq>[#Email]<sq>) from dual]

All of the <sq> ‘s are single quote characters

Line 30 in the above screen shot sends me an e-mail with both the input fields for checking…

 

 


Forum|alt.badge.img+10
  • Author
  • Hero (Customer)
  • Jan 23, 2025 12:25 PM UTC

Hi ​@KIMKIMANDREW 

Success, I was adding a ; at the end of the select statement which was the issue.

Thankyou for all of your help.