Page 1 of 1

Emailing Invoices - Subject Line

Posted: 25 Jul 2019, 09:02
by Abbyy
Good morning!

I am hoping for some help please with constructing a new expression to determine the subject line of an email when sending 1 or multiple invoices.

On both of the templates I mainly use, the current expression under Report; Email Settings; Subject is:

"Invoice " + INVOICE.INVOICE_NUMBER + " from " + COMPANY.NAME

So if I am just sending one invoice, say no 123, the email subject line will read "Invoice 123 from *our company name*" which is fine.

However, if I am sending multiple invoices to one customer the invoices will attached as a file per invoice all to the same email - I am happy with this as I think customers would get annoyed receiving 10 emails for 10 invoices. Annoyingly though, the subject bar only picks up the 1st invoice number, and will still read "Invoice 123 from *our company name*" even if invoices 456 & 789 are also attached.

One of our suppliers uses sage (assuming so as they have a sage pay button), and their subject bar varies depending on how many invoices are attached. So if they just sent one invoice it's "Invoice 112233 from *their company name*", but if they send multiple it's just "Invoices from *their company name*"... Can you please help me to construct an expression so that our subject line would read something similar to theirs?

It probably doesn't seem like it's that big a deal, but a customer recently used it as an excuse to only pay 1 of 3 invoices attached to an email :roll:

I am on version 25.1.128.0 if that helps.

Any help would be greatly appreciated!! :D

Re: Emailing Invoices - Subject Line

Posted: 25 Jul 2019, 09:11
by brucedenney
The issue is that the invoice.invoice_number variable is a number so you are trying to add a number to a string and that doesn't work.

You can fix this by using the cstring function to convert it to a string.

CSTRING(INVOICE.INVOICE_NUMBER)+" my text" + TABLE.STRING_VARIABLE

Re: Emailing Invoices - Subject Line

Posted: 25 Jul 2019, 10:39
by Abbyy
Thank you brucedenney

I'm not familiar with the CSTRING function and that doesn't seem to want to work for me :cry:

Re: Emailing Invoices - Subject Line

Posted: 25 Jul 2019, 10:48
by brucedenney
I think your other supplier must be using 2 different layouts as it is not possible to "know" how many invoices are attached.

Think about a scenario such as 2 invoices a credit note a proforma and a quotation all on one email.

Sorry about the confusion I need to read things more thoroughly.

Re: Emailing Invoices - Subject Line

Posted: 25 Jul 2019, 11:01
by Abbyy
No problem thank you for your help :)