Script to Check if Bill-To Email Address in Active and/or Valid

Description of Issue: 

When trying to email invoices from the Sedona Office Email application, emails are not going to customers. 

Resolution: 

The issue could be because the email is flagged as invalid or inactive. 

If this is happening to more than one or two customers, you can use the script below to show any records where the primary bill to email is inactive or invalid. 



select c.Customer_Number, c.Customer_Name,b.Email_Cycle_Invoice,b.Email_Job_Invoice,b.Email_Other_Invoice,

b.Email_Service_Invoice,b.E_Mail,e.Is_Primary,e.InValid,e.InActive,b.*

from AR_Customer_Bill b

inner join AR_Customer c on c.Customer_Id =b.Customer_Id

inner join AR_Customer_Bill_Email e on e.Email_Address=b.E_Mail

where e.Is_Primary='Y' and e.InValid='Y' or e.InActive='Y'

If for some reason the records were marked inactive or invalid by mistake, the script below will update these records to make the email address valid again. 

Back up the table before making changes. 



select * into AR_Customer_Bill_Email_backup1234 from AR_Customer_Bill_Email

This will update the email records in AR_Customer_Bill_Email to make them active again. 



Update e

Set e.InActive ='N',e.InValid ='N'

from AR_Customer_Bill b

inner join AR_Customer c on c.Customer_Id =b.Customer_Id

inner join AR_Customer_Bill_Email e on e.Email_Address=b.E_Mail

where e.Is_Primary='Y' and e.InValid='Y' or e.InActive='Y'

If the change is only for a few of the records returned add an additional filter in the Where clause to limit to the bill to ID or email ID. 

To limit to a specific bill to ID. 



and b.Customer_Bill_Id in(123)

To limit to email ID

and e.Customer_Bill_Email_Id in(1234)

Was this article helpful?
Thank you for your feedback!
User Icon

Thank you! Your comment has been submitted for approval.