Skip to main content

Questions tagged [formatting]

About formatting data such as String, Datetime, etc.

Filter by
Sorted by
Tagged with
1 vote
1 answer
420 views

Format Date field to pass to OmniScript

I am using Apex to retrieve 2 Date fields from the FundingOpportunity object and I want to pass them back to my OmniScript via Integration Procedure. However the issue I'm running into is they are ...
stormy's user avatar
  • 51
0 votes
0 answers
55 views

Strange behavior for date field in Experience cloud

In a date field displayed in Experience Cloud, if the date is mm/dd/yyyy, and I manually enter 14/01/2024, it will display as 02/01/2025 when I click outside the date field. <lightning-input name=&...
mackmama's user avatar
  • 709
0 votes
1 answer
1k views

Remove tags from Rich Text Area

This is probably super simple but I can't figure it out. I am combining the text from two rich text area fields into a long text area field and I am getting all the formatting tags in the result. Is ...
Matt M's user avatar
  • 1,477
-1 votes
1 answer
81 views

Vİsualforce page Currency decimal formating [duplicate]

i want to format my currency in visualforce page pdf. Intead of 123,456.78 i want to display 123.456,78 I mean, integer parts will separate with dot. Decimal parts will separate with comma. I tried to ...
Hakan Cenk Kalınoğlu's user avatar
0 votes
1 answer
44 views

Visualforce displays decimal number 0.43 as .43

I am trying to display numbers with up to 2 decimal places in my Visualforce PDF. If the number is bigger than 1 (i.e. there is no 0 at its front), the value is shown correctly. However, in cases ...
hajidayi's user avatar
0 votes
0 answers
105 views

How to store large amount of data in a variable for a batch bypassing heap size exception

I am stuck with the following error: 'Batchable instance is too big: ProductDiscountsFormatterBatch' I have a junction object called Account_Product_Discounts__c with the information of, for each ...
Arnau LS's user avatar
-1 votes
1 answer
75 views

Date conversion from string dd-mmm-yy

I am getting date as a string '03-Sep-24' from an external system. What is the easiest way to parse it and save it in a date field?
vivekvismayam's user avatar
4 votes
1 answer
94 views

URL formatting is broken in Marketing Cloud Data Extensions

We have noticed that since the latest release (08/10/2023) that Marketing Cloud has reformatted all URLs present in data extensions. Formerly, they worked - we often use links in data extensions to ...
TCassa's user avatar
  • 878
0 votes
1 answer
108 views

I have a req to show different date time values based on different condition. One to display time in ISO, then in full date along with time & zone

I want to display time in 3 different formats, along side follow the translation strategy as well. That is if user selects to translate the page, user should be able to see the date in his/her local ...
SF Learner's user avatar
4 votes
1 answer
335 views

Is this a bug in Apex DateTime.format?

I have a failing test that I've narrowed down to the DateFormatTest.d31 case below. The test results are: TEST NAME OUTCOME MESSAGE ...
Keith C's user avatar
  • 136k
0 votes
1 answer
45 views

Having issues with handling text field

I have one requirement where text field have information like below format: String name = 'email,phone(Jason),mobile,address(Mason)'; Now what I want to do is create a Map<Key, List<String>&...
Sam Rickert's user avatar
1 vote
1 answer
410 views

Apex Code Formatter for SOQL

I want SOQL fields should be in the same line, not every field goes to a new line, Current : Expected : SELECT Field1, Field1, Field1, Field1,.... FROM Object WHERE ... .prettierrc { "...
Sarvesh's user avatar
  • 998
1 vote
1 answer
2k views

Vertical Alignment of Button in Grid Column

In my Lightning Grid one of the columns contains an Input Field and the one next to it contains a button. Ideally I would like the button icon to align vertically with the input field and horizontally ...
Jeff Callahan's user avatar
0 votes
2 answers
2k views

Screen flow format decimal places

I have a screen flow that is displaying a currency field from an object with two decimal places. The problem is that if the decimal part is .00, it is completely dropping the decimal places. Below is ...
Jeff's user avatar
  • 145
-1 votes
1 answer
765 views

Change the CreatedDate format in Apex

I have the following apex code that displays the created date of records: for(let i=0; i<emailMessages.length; i++){ replyBody += 'On '+ emailMessages[i].CreatedDate + ' ' + emailMessages[i]....
shwarma g's user avatar
0 votes
1 answer
2k views

Use Salesforce Flow to check for a certain phone number format

As the title states I'm trying to check if my phone numbers are suitable to be converted to standard format (US only). Specifically, I want all 10 digit phone numbers that do not start with 1 and all ...
salesforceQs's user avatar
1 vote
1 answer
6k views

Formatting of lightning-output-field in grid with LWC

I'm trying to display 2 columns of data in a LWC using . They are displaying ok (ideally I would want the labels not wrapping) but when I resize the browser window, some of the columns can jump to ...
Stick's user avatar
  • 13
0 votes
1 answer
208 views

Default Date/Time In Medium Format 28 Jan 2008, 16:30:05 instead of 28/01/2008, 16:30

Company would like to display the Date format in SF to show the month as text (e.g. Jan instead of 01). From the following article this appears to be the a OOB option by setting the users Local to ...
Jared Hagemann's user avatar
0 votes
0 answers
422 views

Editing the rich text field breaks the formatting

Within the screen flow we are using a custom "inputrichtextfsc" component where we are passing a classic e-mail template with formatting. This is the e-mail template (just for an example): ...
arturs's user avatar
  • 1
0 votes
1 answer
2k views

lightning-formatted-time with only HH:MM

Trying to display the Time in LWC component by using lightning-formatted-time, by default it print HH:MM:SS I would like to print only HH:MM <lightning-formatted-time value={stime.Start_Time__c}>...
SFDC_Beginner's user avatar
1 vote
2 answers
641 views

How to make VScode auto fix missing semicolons Apex?

Hey does anyone here know how to make VSCode auto fix missing semicolons instead of just show where it is missing? I Started setting up Prettier and it will format apex code but not replace double ...
AMMA's user avatar
  • 321
2 votes
0 answers
1k views

Lightning Web Component 'lightning-input-rich-text' Change Font Size

I have a lightning-input-rich-text (LWC) in which I'd like to change the default text size from 12 to 10. On following the instructions in https://developer.salesforce.com/docs/component-library/...
RedQueries's user avatar
2 votes
1 answer
2k views

LWC Datatable percent data alignment off

So I've tried both of the solutions posted here: Lightning datatable column value misaligned and neither of them are working for what I have. The column above is the only sortable column in the ...
Asmodahlia's user avatar
0 votes
1 answer
159 views

Shorten zipcode in email using ampscript?

The data extension I'm working with has a zipcode field that, for some people, populates the 5-digit zipcode and for others it has the additional 4 digits. Is there a way with ampscript that I can ...
Calley's user avatar
  • 1
0 votes
0 answers
3k views

Lightning Web Component datatable - date time formatting

I'm creating a LWC with datatable that shows some of the key record values. I have just one issue - regarding the date/time formatting. For some reason, the field is shown as: My goal is to show it ...
Omnia's user avatar
  • 191
3 votes
1 answer
5k views

Prettier errors out when formatting Apex classes

I have prettier and prettier-plugin-apex node modules installed. Formatting LWC and JSON works fine with prettier but get the below error when formatting Apex files. Never had this issue on my old ...
Naga's user avatar
  • 475
2 votes
0 answers
57 views

1 in superscript converts to tt

I'm trying to add '1' in superscript to input: but '1' is displayed as a 'tt' What is the way to add '1' in superscript to be shown properly?
Patryk Bukowski's user avatar
0 votes
1 answer
443 views

Left align currency symbol but right align the number in LWC [closed]

Is there any way to Left align currency symbol but right align the number in LWC? Example: $    2500.38 $      127.63 $        99.01
Cloud Man's user avatar
  • 1,357
1 vote
0 answers
124 views

Salesforce record to Excel

So I'm trying to build a Visualforce page that takes some data from an individual record, displays it in a table and populates the appropriate fields, as well as leaving some fields empty, and exports ...
CraneLanding's user avatar
0 votes
1 answer
876 views

LWC Datatable values formatting

Below is an image of standard account history related list and another one that I am trying to replicate. I am not sure how to get the field label from Field from AccountHistory. Also, how to go about ...
mSinisa's user avatar
  • 51
1 vote
0 answers
277 views

Empty lines after each line in LWC meta files

After sfdx force:source:retrieve -x manifest/package.xml my meta files (only LWC) have empty empty lines after each line. Before retrieve: <LightningComponentBundle xmlns="http://soap.sforce....
вася васечкин's user avatar
5 votes
2 answers
892 views

formatGMT YYYY returning next year and yyyy returning this year?

We noticed a behavior with formatGmt function especially around using YYYY vs yyyy, anyone facing the same? Below is showing one year ahead: system.debug('GMT Time'+System.now().formatGmt('E, dd MMM ...
Chirag Mehta's user avatar
  • 1,261
0 votes
1 answer
490 views

Date format in Marketing Cloud email based on locale

I am looking to show the date in two different formats based on locale (the locale variable is set to LocaleCode earlier in the email). For en-US it should be January 1, 2021 and all other locales it ...
highbranch's user avatar
0 votes
1 answer
452 views

Change DoB format to 'yyyymmdd' in Marketing Cloud

I am trying to pull in DoB from a Data extension via ampscript and change the date format to be 'yyyymmdd' where am i going wrong? %%[var @DoB, SET @DoB = [Date_of_Birth__c] ]%% set @DoB = ...
Chrisann Barnard's user avatar
4 votes
2 answers
2k views

Use Prettier in VS Code to format Visualforce

I'm struggling to get the Prettier for Apex (installed as per instructions here enter link description here) to format Visualforce Pages and Components. I have a vague memory of this working for me in ...
alesremta's user avatar
  • 453
6 votes
1 answer
7k views

Is the time-zone attribute broken in lightning-formatted-date-time?

Based on my reading of the documentation that includes statements like this: When using the component to display a date only, without time, include time-zone="UTC" to ensure the correct ...
Keith C's user avatar
  • 136k
1 vote
2 answers
1k views

In Apex, how can I format Datetime for Europe/Berlin without assuming the input value is GMT?

I currently have the following function: public String formatForGermany(Datetime targetTime) { return this.format(targetTime, 'Europe/Berlin'); } private String format(Datetime targetTime, String ...
Brian Kessler's user avatar
0 votes
1 answer
259 views

How to format my Salesforce time field for input in visualforce?

I have a time field (new time field format) called Time_In_1__c in a visualforce page. When I enter a value such as "3:00 pm" and hit save, Salesforce displays the value as 15:00:00:000. I'...
Collen's user avatar
  • 13
1 vote
2 answers
3k views

How to format a date in a javascript?possible [closed]

How can I format a date object to print as today instead of showing a numeric date in a javascript? I'd like to display it like this: today At 5:00 PM. js var today = new Date(); var date = new Date(...
Meenu rosy's user avatar
5 votes
1 answer
1k views

Any formatting JavaScript APIs in LWC?

I'd like to format a currency value that a user inputs in a modal dialog as part of a lightning-datatable field that is composed of some fixed text and that currency value. But AFAIK there are no ...
Keith C's user avatar
  • 136k
1 vote
1 answer
2k views

Prettier formatting tabSize and printWidth

In VS Code preference, I set the Tab Width = 4 and Print Width = 120, but when I format, I can still see the tabSize being 2. Is there any other configuration that I need to do? Thanks.
Sudipta Deb's user avatar
  • 1,263
0 votes
0 answers
67 views

Replacing HTML Code in a String [duplicate]

We're being passed a field in a data string with the HTML code '&dollar;'. We're wanting to change that to '$', since when we send emails it still shows as '&dollar;' and not '$' on a web page....
chorlesbarkley7's user avatar
0 votes
1 answer
424 views

Ampscript to change a certain value in a dynamic field

So our data team is passing a value in a data extension that they want to display as a dollar sign, e.g. "$0.499". However, when read in our email, it displays the HTML and not '$'. Is there ...
chorlesbarkley7's user avatar
1 vote
1 answer
2k views

Is there a way to invoke Salesforce's phone number formatter on a given string?

I want to take all the phone numbers for a given contact in from a SOQL query (which provides the phone number in a raw format) and then have all of the phone numbers in this format as options in a ...
Robert Hyatt's user avatar
1 vote
1 answer
1k views

Format decimal according to locale, but with fixed number of decimal places

There were many question around the topic of formatting decimals according to user's locale and rounding decimals, but I haven't seen the one that actually fits my case, so here I go. I am creating ...
Wookie88's user avatar
  • 723
0 votes
0 answers
2k views

Salesforce removing line breaks when importing data from CSV

We're currently busy with a migration of data from our old system to our brand new Salesforce system. As part of this migration, we're migrating data fields that contain flat text with line breaks, ...
Fengshen's user avatar
0 votes
1 answer
320 views

Apex format function returning weird dates

I am attaching a screenshot which shows a code sample and it's output also. When I normally debug the created date it shows me correct output and then when I try to format it using format function it ...
karan's user avatar
  • 170
1 vote
1 answer
1k views

Can you format merge fields in Salesforce email templates?

Basically I am trying to create some email templates that send out to our users that contain a phone number. A lot of these phone numbers are formatted with no parathensis or dashes, and are in the ...
Frank Evers's user avatar
3 votes
0 answers
329 views

End of File issues with Prettier formatting for javascript

I've got the following prettier config in my repo. When I commit a .js, .css file for an aura component, save it to salesforce org, and retrieve it, I find that my git repo complains that something ...
markgarg's user avatar
  • 734
1 vote
1 answer
574 views

Date formatting for SOQL String - unexpected output

I have '273' added as a day with the following line: DateTime.newInstance(dStart.year(), dstart.month(), dstart.day()).format('DD-MM-YYYY'); so the output looks like '273-09-2019' - what gives? I ...
wmin's user avatar
  • 69