Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [formatting]

About formatting data on the view of Visualforce pages.

Filter by
Sorted by
Tagged with
0
votes
1answer
11 views

Dataloader.io Importing numbers with extra zeros

While trying to import/update some Contract records in my Salesforce system, I have run into issues with the formatting and consistency of currency fields. If I update a currency field with the ...
-3
votes
1answer
42 views

make text highlighted red & bold if criteria is met?

i have a requirement that if my text field has a certain value it should be displayed highlighted red and bold. at first thought i'm thinking i have to change the field type to a formula field that ...
0
votes
1answer
19 views

Format an Integer as a number in VisualForce page

I am trying to format the field BodyLength of the Attachment Object which is an Integer in my VisualForce Page. This should work but it doesn't. <apex:outputText value="{0, number, ###,###,###,###}...
1
vote
1answer
26 views

AMPscript: Including Ordinal Indicators In Date Formatting

I have an automated email that will be sent every month and I'm trying to get the expiry to reference the last date of the current month formatted to read 31st January, 2019 or 28th February, 2019. I'...
0
votes
0answers
38 views

Formatting a derived measure that was calculated from multiple datasets

I understand how to format a derived measure using the XMD. But here, my derived measure comes from multiple datasets. Here is my SAQL: q = load "Dataset1"; q = group q by all; q = foreach q ...
0
votes
1answer
81 views

LWC HTML formatting using prettier

I am using Prettier for formatting HTML code in Lightning web component but it is adding quotes around properties. This is not required for LWC and it throws an error. I tried different Quote Props ...
1
vote
2answers
427 views

Formatting Datetime.now()

I need to format my Datetime.now() to be accepted for a SOAP request. I can't seem to find a way to format it online. Can anyone advise? I need it to look like: 2019-05-02T21:20:29.999Z Currently I ...
0
votes
1answer
210 views

Date Format in VisualForce Page

I need this date format in a visualforce page as MM/dd/yy, below is the code. But in page it display as Fri Mar 08 00:00:00 GMT 201903/08/19, Can you please help me on this? <apex:commandLink ...
0
votes
1answer
465 views

Apex convert string mm/dd/yyyy hh:mm:ss to standard system date (yyyy-mm-dd 00:00:00)

I am trying to convert string from google docs "1/16/2019 11:52:38" to standard system date "2019-01-16 00:00:00". I was able to achieve that using substring method but I am pretty sure there is a ...
1
vote
1answer
3k views

Lightning:datatable number formatting

I have created a lightning:datatable to display order lines. The order lines are fetched via a REST call. I parse the JSON response and add to the datatable data attribute. Everything works fine but ...
1
vote
2answers
829 views

Lightning Component - Date formatting not consistent with standard UI

I am using lightning:datatable to render data including dates. My date column definition looks like: { label: 'Expiration', fieldName: 'ExpirationDate__c', type: 'date'} The date in the table is ...
0
votes
1answer
669 views

Converting Currency to Decimal And Converting Back To Currency Display in Email Template

I have a currency field that I multiply by .5 in my apex code. This changes the data type to a Decimal. I want to display on a visualforce email template the newly updated number as a currency. ...
2
votes
2answers
724 views

Is it possible to make text bold in a custom label?

Background We have a custom application which we need to support in multiple languages. Visualforce is our main UI framework. For internationalization we will use Custom Labels. One of the possible ...
0
votes
1answer
238 views

Unordered List with no bullets not working with email template

I have a Visualforce Component that has a un-ordered list. I want that list to have no style other then the indentation. Usually with HTML you would just specify the ul css to be list-style:none or ...
3
votes
0answers
199 views

Moment JS but for Salesforce Apex

Are there any open source libraries similar to Moment JS but for Apex? Reference: Moment JS
1
vote
1answer
396 views

Break tag inside rich text field in lightning

We use a Visualforce page to automatically fill a rich text field with some generated content. After that, the user is allowed to edit the content before it's displayed on a website. After our ...
0
votes
1answer
340 views

Marketing Cloud - Timezone - Format/Display

I guys. Need your help, please. 1 -I know the dates in Marketing are saved in CST timezone, but when I view them in "form mode" I need to see them as GMT / UCT. I have already set up account and user ...
0
votes
0answers
203 views

Formatting parameterized custom label inside subject for Visualforce Email template

I'm trying to use the format() visualforce function to have a parameterized custom label as my Visualforce Email Template subject. This is my current code: <messaging:emailTemplate ...
0
votes
2answers
308 views

Checkboxes Don't Align on Visualforce page

Checkboxes Don't Align I have two groups of vertical checkboxes on a Visualforce page and the top one in both columns is about two spaces to the left of the others. What is the best way to format the ...
1
vote
1answer
362 views

How to get current user date/time format in apex, e.g. MM/dd/YYYY hh:mm:ss a z

We need to figure out current user date/time format in apex code to send it to our mobile app in order to display data in same way as it is in Salesforce itself. In other words, it's about getting ...
1
vote
1answer
463 views

Visualforce format an output number depending on decimal value, if decimal is zero then just display the number

I am trying to display multiple values in a page which are currency fields set with 2 decimals (in the object). Currently I am using the below expresion to format the values which works great: <...
0
votes
0answers
220 views

Date Format: Apex Callout (Soap webservice)

We are performing an apex callout from Salesforce to a SOAP based webservice and it requires us to pass a date in the following format: MM/DD/YYYY (note: this should be date datatype). When I am ...
0
votes
1answer
4k views

Using lightning:input with type=“number” and formatter=“currency”

Is there a way to use lightning:input with formatter="currency" to show whole number instead of Decimal number <lightning:input aura:id="{!item.Id + 'CY_Tile_Budget__c' }" type="number" name="...
0
votes
1answer
666 views

How do I convert a String to Decimal in Apex using a specific locale?

I am receiving as a response from a third-party webservice a JSON having prices formatted in a different way depending on locale. Below some examples of the format of the text sent (depending on the ...
0
votes
1answer
192 views

How to replicate NumberFormat based on locale in salesforce

I want to show currency on VF page in different formats based on locale used on the template. NumberFormat class is available in Java to achieve this but in apex is there any way to achieve this. ...
0
votes
1answer
1k views

Formatting as a currency on a VF page

I'm trying to render a currency value to a VF page. Whether I use Decimal or String, it still doesn't seem to work with the OutputText formatting :- <apex:column> <apex:facet name="...
0
votes
1answer
624 views

AMPscript Date Formating for French Language in HTML emails

This puts today’s date in my HTML email: %%=Format(Now(), "MMMM d, yyyy")=%% Any idea how to format this for FR? I've tried doing this and it doesn’t work: %%=Format(Now(), "MMMM d, yyyy","fr-CA")=...
1
vote
1answer
90 views

If Statement to format a value depending on a Picklist value of another field

Any Help would be much appreciated- I actually will be doing this for several different currency values If I could use a case statement even better. I know it should be in a class but I do not have ...
0
votes
2answers
938 views

Format VF Page Input Field to 2 decimal places

I would like to format the default inputField value on a Visualforce page. The underlying standard field has a data type of number(10,5). I want this on my VF page with 2 decimal places. How can I ...
1
vote
1answer
610 views

VF Email Template - Convert GMT to EST/EDT without components/controllers using date formatting?

We are creating a Visualforce email template to be sent when certain Events are saved/edited to meet criteria. The VF Template is related To Event/Contact: <messaging:emailTemplate subject="...
1
vote
0answers
128 views

Ordinal Indicators In Date Formatting

I've been using the following bit of code in my Visualforce pages to get the so called ordinal indicators (the 'st', 'nd', 'rd', and 'th' in 1st, 2nd, 3rd, 4th) when formatting dates. <apex:...
1
vote
1answer
444 views

Difference between 2 Date fields

In my record I have to datetime fields, now() and Create date. I want to do the difference between them and put this difference in the form: example: TOT days TOT hours TOT minutes TOT seconds. Is it ...
0
votes
1answer
125 views

VF page, using remote objects, in jquery need to format Date and Currency field

I'm using remote objects for this page. I'm trying to format the field Invoice_Amount__c to contain commas which will separate the numbers and format the Invoice_Date__c field to mm/dd/yyyy. I ...
2
votes
1answer
375 views

Format date from: 01/01/2017 to 1/1/2017

Got this code: <apex:outputText value=" {0,date,MM/dd/yyyy }"> <apex:param value="{!IF(Lead.CreatedDate!=null,Lead.CreatedDate+90,'N/A')}"/></apex:outputtext> how to format date ...
2
votes
1answer
394 views

Online formatter tool for the list output in debug log

do we have any tool just like JSON formatter, XML formatter to format the list output that is coming in debug log text. For example, [AccountOwner=null, Address=25 S. aka Ave. Duluth MN 802 US, ...
0
votes
2answers
797 views

Date format from Apex variable in VF

apex:variable var="Expiry" value="{!if((TEXT(object.Executed_Expiry_Date__c)!=null && TEXT(object.Executed_Expiry_Date__c)!=''),object.Executed_Expiry_Date__c, object.Expiry__c)}" ...
2
votes
2answers
1k views

How to format a Visualforce inputField [duplicate]

I want to format the default inputField value on a Visualforce page. I am pre-filling the number field with 1 but it is displaying as 1.00. The underlying standard field has a data type of number(10,...
0
votes
1answer
856 views

Removing leading zeros in a string in a VFP page?

I have a VFP that displays a list of cases and includes the case number column like this: <apex:column > <apex:facet name="header"> <apex:commandLink value="Case #" action="...
1
vote
1answer
34 views

Add > in Visualforce Template Email Subject

I need to add > to the subject of Visualforce email template. Like: Wayne Enterprise > Bruce Wayne Directly adding > in the subject doesn't work. I have tried adding HTML code as shown below but ...
0
votes
1answer
282 views

Command Line Data Loader - how to format the date?

I am using the CLI Dataloader to successfully extract records from Salesforce as part of an interface into Back Office Systems. I have a query, a bit like this: SELECT ID , ClosedDate, createdDate,...
1
vote
1answer
607 views

Calculating the last day of next month using Ampscript

I'm looking to populate the last day of the following month for a promotion that we are running in an email. So, regardless of the current date, the promo will always end the last day of the following ...
2
votes
2answers
908 views

Conditional Cell Color in VF dataTable

I'm using a custom controller to query OpportunityFieldHistory to find changes to Close Date within a given timeframe. Then, the query results are displayed in a VF dataTable. I can display OldValue ...
1
vote
1answer
338 views

How to fix formatting in <apex:pageBlockSection

How can it be align to rest of the fields like how it has Start/End date... like to avoid using style like left-padding etc... Screen shot how it looks after it renders: Here is my VFP code that ...
4
votes
1answer
345 views

How to programmatically double apostrophes in custom label translations?

I have a custom label which contains a couple of parameters: Hello, {0} the other param is {1}. I wish to output this value in a Visualforce Page like so: <apex:variable var="firstParam" value="...
0
votes
2answers
754 views

Visualforce pageBlockTable - update values in cells on load

I've been developing a page that displays dollar amounts in a table, and allows updates to those amounts. This table is read from and writes to a JSON string. Some of these dollar amounts have many ...
2
votes
1answer
355 views

How to get default field formatting with outputText?

So I know I can just render a field with its default formatting using outputField: <apex:outputField value="{!MyObject__c.MyDate__c}" /> If I try to render the same field using outputText I ...
4
votes
2answers
960 views

Visualforce currency euro

I need to display currency. This field is Roll-up summary of formula fields with return type 'Number' <apex:outputText value="{0, number, currency}"> <apex:param value="{!Invoice....
1
vote
1answer
131 views

Why week of year is wrong?

I'm using this code : Time t = Time.newInstance(12, 0, 0, 0); DateTime dt = DateTime.newInstance(Date.parse('22/02/2016'), t); system.debug(LoggingLevel.WARN, Integer.valueof(dt.Format('w'))); It ...
2
votes
0answers
3k views

How could I do line breaks (/n or /r/n) on Messaging.SingleEmailMessage PlainTextBody?

I know this question is asked before and could found in the below links, (I am posting this as I want to post my code with some changes to the solutions provided in the below links.) PlainText email ...
0
votes
1answer
2k views

Trim/remove trailing zeros from decimal apex:inputfield

We have a decimal apex:inputfield that supports up to 12 decimal points; however most of our cases will not use more than 4-5 decimal points and we don't want to clutter the page with extra zeros. ...