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

Use Custom Labels in Custom Object

Is there a way to use Custom Labels in a Custom Object?
When you say "Custom Labels", what are you referring to? Field labels?
The Custom Labels that you create by going App Setup > Create > Custom Labels.
As far as I know, the only way to use these is by creating a Visual Force page to show your custom object while referencing these labels. They can be reference on VF pages by using something like (as seen in the documentation where "firstrun_helptext" is a label name):

I tried to do exactly what you're saying first, but I was having trouble getting the Visualforce page content to show up in my Custom Object. I can drag the Visualforce page (that calls the Custom Label) into my Custom Object, but for some reason the content from the Visualforce page won't show up. Any idea what I might be doing wrong?
Could you please share your code so that we can understand the exact problem?



<apex:page standardController="Name_of_Custom_Object__c"> <p>Test visualforce insert label</p> <p>{!$Label.test1}</p> <p>{!$Label.test2}</p> </apex:page>

Once I made this Visualforce, I am able to drag it into my Custom Object's layout. The problem is nothing shows up on a preview of that layout. When I view the Visualforce page on it's own, I can see the content of the test1 and test2 labels.  



Any thoughts on why it doesn't work on in the Custom Object layout?

Message Edited by gringoese on 01-28-2009 11:01 AM
Message Edited by gringoese on 01-28-2009 11:32 AM