Need more, need help now? we offer pay-as-you-go support, no contract, tenth of an hour billing, expert help, fast service, no call queue
We can offer lower cost Sage50cloud subscriptions for customer using pay-as-you-go support or who are self-supporting.
Need integration, your shipping system, your website, your invoicing system, your crm.
Need a bespoke solution, Mini Manufacturing, Spreadsheet order import, Back to back orders.
Want web hosting, email, your own domain name, a shop, we do it all!

Removing Time stamp from Email Filenames

Report design issues and solutions.
Post Reply
pauljj
User
User
Posts: 48
Joined: 11 Sep 2014, 11:38
Sage Version: v2018 24 UK/Europe/Africa

Removing Time stamp from Email Filenames

Post by pauljj » 05 Feb 2018, 12:11

Hi Bruce,

I am emailing a GDN note in PDF format and have customised the filename thus

"DN-" + GDN_ITEM.GDN_NUMBER + "-" + SALES_ORDER.NAME + "-" + GDN_ITEM.DATE

this works fine until i go to my outlook and see that the filename date portion includes the date as dd_MM_yyyy and has also included a time portion (see attached)
In the report itself, i have formatted the GDN.ITEM,DATE field as short date dd MM yy , i have tried removing the time portion completely and tried different settings just to see if it has any effect, which it doesn't, so i'm thinking it's some system setting somewhere ?

I would like the filename to include the date in short format if possible with no time included ?
Thanks
Pauljj
PDF EXAMPLE.JPG
You do not have the required permissions to view the files attached to this post.

pauljj
User
User
Posts: 48
Joined: 11 Sep 2014, 11:38
Sage Version: v2018 24 UK/Europe/Africa

Re: Removing Time stamp from Email Filenames

Post by pauljj » 05 Feb 2018, 12:19

to add - would it be something like this ?

DateTimeToFormattedString(date,format)

i need to be looking at ?

pauljj
User
User
Posts: 48
Joined: 11 Sep 2014, 11:38
Sage Version: v2018 24 UK/Europe/Africa

Re: Removing Time stamp from Email Filenames

Post by pauljj » 05 Feb 2018, 12:43

Think i'm on the right track now

"DN-" + GDN_ITEM.GDN_NUMBER + "-" + SALES_ORDER.NAME + "-" + DateTimeToFormattedString(GDN_ITEM.DATE, "ddMMyy")

has gotten rid of the time portion, the separators came out a little differently so " /" were replaced with underscores, for me this isn't an issue to remove separators completely as our file system works well without them.

does this look like I've followed the correct process?

User avatar
brucedenney
Site Admin
Site Admin
Posts: 4260
Joined: 28 Feb 2006, 09:56
Sage Version: v2017 23 UK/Europe/Africa

Re: Removing Time stamp from Email Filenames

Post by brucedenney » 05 Feb 2018, 13:00

Sounds like it, sometimes when you build these strings you need to convert and format with formatstring eg

formatstring("{0:f2}",SALES_LEDGER.BALANCE)

Formating string appears to follow the convention for c# so... these should be a guide, the help file isn't that good. Slashes in filenames represent subdirectories, so you do not want to use them normally. They are also escape characters so in places where you do want to use them, like paths for images you need to double them up eg \\ so it knows you literally want a \ rather than to modify the next character.

http://www.csharp-examples.net/string-format-datetime/
http://www.csharp-examples.net/string-format-double/
http://www.csharp-examples.net/string-format-int/
For just about anything Sage :- switch to subscription, pay-as-you-go support, sagecover, upgrades, application integration, reports, layouts, analysis or any other help making life with sage easier/less time consuming Contact me. Image

User avatar
brucedenney
Site Admin
Site Admin
Posts: 4260
Joined: 28 Feb 2006, 09:56
Sage Version: v2017 23 UK/Europe/Africa

Re: Removing Time stamp from Email Filenames

Post by brucedenney » 05 Feb 2018, 13:06

P.S.

If you want to make filenames easy to find by Date use the ISO date format YYYYMMDD this when sorted alphabetically also sorts chronologically, you may have noticed sage adopted this convention for backup file names.
For just about anything Sage :- switch to subscription, pay-as-you-go support, sagecover, upgrades, application integration, reports, layouts, analysis or any other help making life with sage easier/less time consuming Contact me. Image

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest