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

Visual Force Email Template - Date Format Issue and general VForce assistance

I'm looking for a method to format a datestamp field into a dd/mm/yyyy field.
The object we're refferencing is the default Opportunity object.

Currently returns:
Start Date:Tue Nov 25 00:00:00 GMT 2008
Would like it to return:
The code for this is:
Start Date:{!relatedTo.EngagementStartDate__c}<br />

Anyone have any ideas? Everyone says to use the get, methods on a date, but our sforce resource stated that I can't do that in a template or merge document.


While we're here, I'd like to also merge in information of the Primary Contact. I know this is a one line requirement that has a whole slew of problems, but my alternative is writing a trigger that populates a new lookup field with the primary contact and using that field to drill to various pieces of information, this is a REALLY cumbersome solution, I'd rather call on the related contact roles list, but accounting the resource, if/else functions don't work on that list.

Message Edited by Nonick on 11-26-2008 05:24 PM
format like this

is there anything special I need to do to make an object an official child of another object?
I've got a master/detail field in the custom object linking it to the opportunity, but the opportunity doesn't list it as a child.
Trying to use the following code to pull the material:

    <table border="1" >
            <tr > 
            <apex:repeat var="cx" value="{!relatedTo.Practice_Service_Offering__r}">
            <td><a href="{!}">View</a></td>


actually it DOES show it in the apex explorer but the name of it is something along the lines of R00N20000001CFcUEAW
I don't want to hard code that beast anywhere.

Message Edited by Nonick on 11-26-2008 10:08 PM
The problem here is that the child relationship name for your relationship is not set. We've seen this happen after creating new reference fields (lookups & master/detail relationships) under various conditions in the past and we believe we covered all the bases for any relationships you define as new now. 

When you encounter this scenario you can address it by navigating to the lookup or master-detail relationship field edit page and entering the desired value for the "Child Relationship Name" field. The best value for this is usually a qualified version of the Related List Label.

The value *should* default to the name qualified version of what you provide in the Related List label field in the custom field wizard for relationships going forward.

That was exactly it, further research showed that the relationship was lost during a consolidation done before my time. Resetting the child worked well. The fact that the master/detail field was there but the relationship wasn't through me. Appreciate your help.

Can someone please give me a hint where these functions are documented?




I assume there are lots of more nice helper-functions but I could not find anything in the visual force documentation.



Ron WildRon Wild

Yes!  Documentation on these functions would be very helpful.  Anyone know where a complete list might be?




It is not clearly documented, but you can use all formula field functions as described in the help section:




Worked. But if those fields are blank, the two slashes "//" remains. Is there any way to hide them?


try to surround it with an IF, e.g.




Excellent!  Thanks for the date format.  Solved my problem before i had to ask the question!