+ Start a Discussion
Jon Hayes CHIJon Hayes CHI 

Date format within URL parameter

I am building a VF email template that contains a URL to create a record and prefilling some fields on the form. Of the fields is a date field and it only serves as a reference to the user but needs to be readable. I need to remove the time zone/offset from the date that is rendered into my URL. I know how to output the format I want anywhere else in the email but as part of an <a href".. tag I do not know how.

My URL looks like this:
Click<a href="https://na3.salesforce.com/a1B/e?CF00N0L0044062bDo={!relatedTo.Name}&CF00N0L0044062bDo_lkid={!relatedTo.Id}&CF00N0L4400062bDx={!recipient.name}&00N0L0055062bE2='{!relatedTo.Start_Date__c}"> HERE</a> to respond.<br />
But the field "Start Date" renders as :
Fri%20Jul%2014%2000:00:00%20GMT%202017
Is there an equivalent to this:
<apex:outputText value="{0,date,MM/dd/yyyy}"> <apex:param value="{!relatedTo.Start_Date__c}" /> </apex:outputText>

that I can do within the href tag to output the date into my URL in a cleaner format?


 
Best Answer chosen by Jon Hayes CHI
Naval Sharma4Naval Sharma4
Try following code.
Click<a href="https://na3.salesforce.com/a1B/e?CF00N0L0044062bDo={!relatedTo.Name}&CF00N0L0044062bDo_lkid={!relatedTo.Id}&CF00N0L4400062bDx={!recipient.name}&00N0L0055062bE2={!MONTH(relatedTo.Start_Date__c)}/{!DAY(relatedTo.Start_Date__c)}/{!YEAR(relatedTo.Start_Date__c)}"> HERE</a> to respond.<br />

 

All Answers

Naval Sharma4Naval Sharma4
Try following code.
Click<a href="https://na3.salesforce.com/a1B/e?CF00N0L0044062bDo={!relatedTo.Name}&CF00N0L0044062bDo_lkid={!relatedTo.Id}&CF00N0L4400062bDx={!recipient.name}&00N0L0055062bE2={!MONTH(relatedTo.Start_Date__c)}/{!DAY(relatedTo.Start_Date__c)}/{!YEAR(relatedTo.Start_Date__c)}"> HERE</a> to respond.<br />

 
This was selected as the best answer
Jon Hayes CHIJon Hayes CHI
Thank you Naval!