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
scottyscotty 

Dates in Hyperlinks

I am trying to add a date value to a hyperlink to pass to a task I have tried tsk4=TODAY() and and '&tsk4=TODAY()&' with no luck.  I do understand that the hyperlink function is all text based, but I really need to pass the Due Date from the Hyperlink to the task.

 

Thanks.

Best Answer chosen by Admin (Salesforce Developers) 
phiberoptikphiberoptik

Replace what you have for tsk4= with this:

 

tsk4='&TEXT(MONTH(TODAY()))&'/'&TEXT(DAY(TODAY()))&'/'&TEXT(YEAR(TODAY()))

 

I just used it and it works correctly. I even added +1 after DAY(TODAY()) and it autopopulated 1/23/2013.

All Answers

Shailesh DeshpandeShailesh Deshpande
Try using TEXT(TODAY()), not sure though
scottyscotty

Thanks for the reply.  This still populates the date field with the text "(TEXT(TODAY())".  I had thought about trying that eariler and thouht i would get that result but it was still worth trying.

phiberoptikphiberoptik

Make sure you do not have any quotes around TEXT(TODAY()) in the URL build. Make sure the previous quote mark is ending a text string and the following one is starting another. This will allow the formula to produce a result.


Can you post your entire formula code for this?

scottyscotty

Here is my formula without the date field

 

I am looking to populate the Due Date tsk4 with todays date.

 

HYPERLINK('/00T/e?what_id='& Account__r.Id & ' &who_id='& Contact__r.Id &' &retURL=%2F' & Account__r.Id & ' &RecordType=01260000000Dos3'&'&tsk12=Completed&', IMAGE('/servlet/servlet.FileDownload?file=01560000000TbKx', 'Custom'))

 

Thanks

phiberoptikphiberoptik

Does this work?

 

HYPERLINK('/00T/e?what_id='& Account__r.Id & '&who_id='& Contact__r.Id & '&retURL=%2F' & Account__r.Id & '&RecordType=01260000000Dos3&tsk12=Completed&tsk4='&TODAY(), IMAGE('/servlet/servlet.FileDownload?file=01560000

000TbKx', 'Custom'))

scottyscotty

Here is the error I receive

 

Error: Incorrect parameter type for operator '&'. Expected Text, received Date

scottyscotty

This formula works, but gives me the date in a YYYY-MM-DD format.

 

HYPERLINK('/00T/e?what_id='& Account__r.Id & '&who_id='& Contact__r.Id & '&retURL=%2F' & Account__r.Id & '&RecordType=01260000000Dos3&tsk12=Completed&tsk4='&TEXT(TODAY()), IMAGE('/servlet/servlet.FileDownload?file=01560000000TbKx', 'Custom'))

phiberoptikphiberoptik

HYPERLINK('/00T/e?what_id='& Account__r.Id & '&who_id='& Contact__r.Id & '&retURL=%2F' & Account__r.Id & '&RecordType=01260000000Dos3&tsk12=Completed&tsk4=

'&MONTH(TODAY())&'/'&DAY(TODAY())&'/'&YEAR(TODAY()), IMAGE('/servlet/servlet.FileDownload?file=01560000000TbKx', 'Custom'))

 

 

...but that would be really funky if it works.

scottyscotty

The formula provided will not vaildate

phiberoptikphiberoptik
What is the error?
scottyscotty

(TODAY()), IMAGE('/servlet/servlet.FileDownload?file=01560000000TbKx', 'Custom'))

 

Error: Syntax error.  the error is at the comma or the closed parenthsis or both (TODAY()),

phiberoptikphiberoptik

Replace what you have for tsk4= with this:

 

tsk4='&TEXT(MONTH(TODAY()))&'/'&TEXT(DAY(TODAY()))&'/'&TEXT(YEAR(TODAY()))

 

I just used it and it works correctly. I even added +1 after DAY(TODAY()) and it autopopulated 1/23/2013.

This was selected as the best answer
scottyscotty

It works perfectly.  Thanks so much for your help.

phiberoptikphiberoptik
Cheers! Glad to have this resolved!