function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Chiel de Graaf.Chiel de Graaf. 

Embed date in text line

I've got an Apex class which writes a description text to a case on creation.
Now i want add a date (today()) into the line of text.

Before deploying this to production (and possibly break the case creation process), can anyone tell me if the following line will do the trick ?
 
Description = 'Gegevens: \n\n Ontvangstdatum: + date.today() \n\n nummer:  ' + Code

 
Best Answer chosen by Chiel de Graaf.
Marek Kosar_Marek Kosar_
Hello,
try this:
Description = 'Gegevens: \n\n Ontvangstdatum: '+ String.valueOf(date.today())+' \n\n nummer: ' + Code

 

All Answers

Marek Kosar_Marek Kosar_
Hello,
try this:
Description = 'Gegevens: \n\n Ontvangstdatum: '+ String.valueOf(date.today())+' \n\n nummer: ' + Code

 
This was selected as the best answer
Chiel de Graaf.Chiel de Graaf.
Hi Marek,

I will try this solution next monday. So close to the weekend and no possibilty for me to monitor errors.
Next week i will let you know if it works.
Chiel de Graaf.Chiel de Graaf.
It works like a charm. tx again Marek.