Skip to main content

Questions tagged [format]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
2 answers
61 views

I'm trying to convert 31-05-24 into May 31, 2024

I'm trying to convert 31-05-24 into May 31, 2024 using Format or FormatDate the best i can get is 31-05-24 -- i've even had success with converting 31-may-23 do I need to ask the client for a ...
Gaël Porteu de La Morandière's user avatar
1 vote
0 answers
113 views

Apex, how to formatting Datetime in appropriate language

Once again I'm flabbergasted and disappointed in SF and Apex functionality. Either that or I missed something. It appears that Datetime.format() doesn't return the result in the running user's ...
Ken's user avatar
  • 430
2 votes
1 answer
79 views

How do you only display decimal places if they aren’t zero?

I have numerical data being passed into an email to two decimal places, it could be 10.00 or 10.16 for example. Is there a way I can easily show just 10 if the original number is 10.00, but show 10.16 ...
John D's user avatar
  • 23
1 vote
2 answers
227 views

Downloaded data in excel format using LWC in salesforce. When i open the file it shows warning prompt: File format and extension do not match

Hi, Currently iam implementing functionality of downloading data using LWC by using following code: let doc = '<table>'; // Add styles for the table doc += '<style>'; doc +...
Murali AS's user avatar
-1 votes
1 answer
599 views

Display Created Date DateTime field as DD/MM/YYYY, HH:MM:SS (am/pm) in record detail page

I've been trying to figure out how to display Created Date field with the format: DD/MM/YYYY, HH:MM:SS [AM/PM] By default, Salesforce displays it as DD/MM/YYYY, HH:MM [AM/PM]. See picture below. I'm ...
Dabidee's user avatar
1 vote
1 answer
680 views

How do I change date/time format on object? To 24 hour clock

Every objects I have, the date/time format is in 24 hour clock. So why is there this object with am/pm? How do I change it to 24 hour clock format? The weird thing is that when I edit the field. It is ...
Rasmus's user avatar
  • 13
1 vote
1 answer
122 views

Getting a wrong date format when getting inbox messages on Android

I'm using the react native sdk for SFMC and I have some difficulties with getting the inbox messages from the Android platform. Somehow the date format is like: Fri Sep 30 11:16:00 GMT+02:00 2022 And ...
Nico Martens's user avatar
1 vote
1 answer
510 views

How to format a number so that dot appears in the thousands?

I have a datatable defined as follows: <lightning:datatable data="{!v.mydata }" columns="{!v.mycolumns}" keyField="id" hideCheckboxColumn="true" ...
BlueSac's user avatar
  • 25
0 votes
1 answer
29 views

AMPScript convert "feb" to 02

I'm looking to convert a data field value (@OPT2) from "01-Feb-22" into "01-02-22" to be displayed on a landing page. The reason is I want to display the date in French too and ...
Gaël Porteu de La Morandière's user avatar
1 vote
0 answers
631 views

How to obtain translated full day name from date in Apex?

In Apex, the name of the day can be derived from a date using the format('EEEE') method: Datetime targetDate = Datetime.newInstance(2022, 4, 28, 0, 0, 0); String dayOfWeek = targetDate.format('EEEE'); ...
Shamina's user avatar
  • 4,295
0 votes
0 answers
437 views

How to convert the currency value field to the corporate currency in SOQL

I want to convert the amount field in opportunity object to the corporate currency, I found that the convertCurrency(amount) will give me the value in user's currency format, but I found that the user'...
R_M_R's user avatar
  • 1
0 votes
2 answers
93 views

Convert Task ActivityDate into String

I need in my wrapper class the activity date from the task object as string to display at a visual force page. My two version below does n't work. If I use this version I get an error (Attempt to de-...
Rag21's user avatar
  • 105
-1 votes
2 answers
2k views

Changing of date format in apex [closed]

1.How to change the 2021-06-15T02:30:00.000Z to date(15/06/2021) in Apex? I have tried multiple ways but not working please help me with the code.
bharath sambrani's user avatar
0 votes
1 answer
325 views

How to control formatting of numbers with decimal points?

What's happening now : if the values are getting displayed as eg: 100 and no decimal value then it is displayed as '100' and if Decimal value is '.70', it is displayed as ' 100.7'. What we want : If ...
anjanesh's user avatar
  • 111
0 votes
1 answer
908 views

How to pass input of date picker to controller

Since I have been looking for a date picker which I can format on a visualforce page for a foce.com site I found that salesforce is very limited. I found the following example which I can format and ...
Thomas's user avatar
  • 2,310
2 votes
1 answer
2k views

Visual Studio Code Prettier plugin for Apex not formatting VisualForce [closed]

I've been using VSC for ages now and have had the apex Prettier plugin installed and working, but it is no longer formatting my Visualforce pages (it's still doing it for apex classes). I now get this ...
Irene's user avatar
  • 1,849
2 votes
2 answers
849 views

How to retrieve records created today in Data Extension using AMP script

In my data extension dynamically records will created every day. Here i want know how many records will created every day. I am unable to fetch the today date values in lookuprows for equal to ...
Sfdcprgmr's user avatar
  • 437
0 votes
0 answers
1k views

Display field with the same format in HTML email

I was using email templates feature but for internal reasons we had to move it to custom class. Now I am creating an email template on HTML code on an APEX class. The thing is that when I insert the ...
Julio Didier Maciel's user avatar
0 votes
0 answers
47 views

How to convert the Current User Time from String to DateTime data type? [duplicate]

I have to populate the Current User Time-Zone DateTime in a DateTime field. I am trying this : String str = datetime.now().format(); DateTime d = Datetime.valueOf(datetime.now().format()); DateTime ...
Swapnil Jain's user avatar
0 votes
2 answers
2k views

How to use long date format in LWC

So I've been trying to understand the use of dateTime.longDateFormat in the documentation located here: [https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.create_i18n][1]...
Justin J's user avatar
1 vote
2 answers
4k views

Change date format in formula to MM/DD/YY

I have a formula that uses a date field that returns a date with a format DD/MM/YYYY. I need to change the format of this date to DD/MM/YY. TEXT(DAY(ExpectedDeliveryDate__c))+"." +TEXT(MONTH(...
chloe's user avatar
  • 243
2 votes
1 answer
2k views

Is there a way to default the Export CSV file origin of dataloader to UTF-8?

I export Salesforce data out to CSV on a frequent basis especially in a foreign language like Mandarin. Even if I check the UTF-8 options on Dataloader settings : The file that gets exported out ...
compski's user avatar
  • 1,352
1 vote
0 answers
950 views

Formatting currencies in different locales (DE, EN, ES, FR & PT) in quote

My company is dealing with customers all around the world. We use 5 languages (English being the main): DE, EN, ES, FR & PT. We wanted to send the quotes with localized amounts to our customers ...
A. Akkari's user avatar
1 vote
1 answer
653 views

Using Uncrustify and Prettier with global config files

It seems there are 2 tools that you can use for code formatting: Uncrustify and Prettier. I find the config for both incredibly frustrating because it has to be repeated for each org you set up. Does ...
Apexing's user avatar
  • 334
0 votes
0 answers
310 views

Get LanguageLocaleKey based on timezone ID

I have a custom object called Machine__c and i have a custom picklist field in it called Time_Zone__c. This Time_Zone__c field has the same picklist values as the Standard User object timezone field. ...
Sisir's user avatar
  • 111
1 vote
1 answer
147 views

FORMATDATE and format pattern to add year when using format pattern "M"

I have this code SET @START_DT = "2019-08-05T06:07:08.1230000-06:00" SET @CHANGE_DATE = FORMATDATE(@START_DT),"M","","da-DK")```` Which output format is: august I would like to add the ...
Martin Ho's user avatar
  • 107
0 votes
1 answer
135 views

Idea Apex Live Templates

has anyone used any Idea Live Template for Salesforce? I have recently moved from Sublime to IntelliJ and I was wondering whether any of you has some promising experience with using a specific ...
panza's user avatar
  • 185
2 votes
1 answer
221 views

Is the function that formats phone numbers available?

On a layout, if I update a phone number, Salesforce will automatically format it like a phone number if it can. But if I change it on the backend, like through apex or the developer console, it will ...
SarcasticSully's user avatar
0 votes
1 answer
127 views

Salesforce matrix report

Hi I am trying to create a salesforce report to show the 3 columns Contact owner number of contacts per owner whether contacts have any activity on them or not(sum of relation) My report looks ...
gs650x's user avatar
  • 2,680
0 votes
1 answer
1k views

How to display Month in TEXT format using SQL query in marketing cloud?

I create one Data Extension name is 'TEST' using Day, Month and Year fields. I have done this scenario in number format. But I need to Display Month in Text format. How is it possible? please anybody ...
Shriya's user avatar
  • 33
0 votes
1 answer
173 views

Linting tools for legacy apex repo

I've inherited a messy repo full of legacy apex code - trying to get it cleaned up and readable for some more junior devs on my team. What linting tools do you all use on your apex classes to enforce ...
Isaac V's user avatar
5 votes
0 answers
519 views

How to prevent salesforce from auto- formatting phone numbers

I am using a lightning component to display a phone number. I am currently in France and i want all the phone numbers to follow local formatting, which is not the case when i use the lightning ...
user28829's user avatar
  • 706
4 votes
1 answer
868 views

Round Decimal and .format() it into a localized output String with more than 3 decimal places

Until today I was very happy with this utility method public static string roundNumber(decimal d, integer precision) { if(d == null) return ''; string separator = (1.01).format().substring(1,...
Uwe Heim's user avatar
  • 28.4k
1 vote
1 answer
828 views

Visualforce Excel Export Issue

I'm trying to export a Visualforce page as an Excel document. I've looked at similar questions and the exported file is saved as a webpage embedded in excel which is prompted as unsupported/corrupt ...
Atlas Can's user avatar
  • 1,877
3 votes
4 answers
26k views

How to remove time from date?

The following code returns the time of the current date: System.debug('Current date: ' + Date.today().toStartOfMonth()); Output: 2018-08-01 00:00:00 How to remove time from date?
Cuban coffee's user avatar
  • 1,596
1 vote
1 answer
77 views

Best way to standarize datetime formats in Lightning framework based app

I want to standarize datetime formats in my lightning app. My requirement is datetime display format based on Salesforce user locale settings. One possible approach that is based on static locale -> ...
Grzegorz Połuch's user avatar
1 vote
1 answer
440 views

The $Locale global value provider returns wrong datetimeFormat value

I noticed that lightning have some problem with datetime format. Seems like issue with $Locale.dateTimeFormat that returns wrong value. I set-up my Salesforce org User locale settings to English(...
Grzegorz Połuch's user avatar
3 votes
1 answer
3k views

Datetime.format('yyyy-MM-dd') subtracts a day

Is there a reason that the below returns 2017-11-30? I know changing it to Datetime.newInstance fixes it, but I'm mostly wondering why this happens. Datetime myDate = Date.newInstance(2017, 12, 1); ...
mplax's user avatar
  • 373
3 votes
1 answer
6k views

Format date as two digit month and day

How do you set the .format() method to create a two digit month and day? I have tried this myDate.Format('dd/MM/YYYY') The .format() method has no example of this on the support page. https://...
Matt M's user avatar
  • 1,477
34 votes
8 answers
43k views

Format APEX code Visual Studio code

Has anyone been able to find a formatting extension for Apex on visual studio code? And if so would they be able to share it?
anon's user avatar
  • 443
6 votes
1 answer
3k views

What are the minimum and maximum valid dates in Salesforce?

What are the minimum and maximum valid dates in Salesforce? What is the valid date range in Apex, SOQL or SOAP API? It is hard to find anything in the documentation
Patlatus's user avatar
  • 17.2k
-5 votes
1 answer
305 views

Apex class date format [closed]

I have a problem with date format, if anyone knows what should I write in marked place => "???" Here is my code public class SomeClass { public class DisplayPositionRecords { @...
MagdaH's user avatar
  • 1
4 votes
1 answer
1k views

ui:inputDate how to show month number and not month string

My problem is that I'm not able to get the date with a month number format. This is my code: <ui:inputDate aura:id="input" value="2018-01-01" format="dd-MM-yyyy" ...
Ismael Slimane's user avatar
1 vote
2 answers
846 views

Exporting a data extension messes up the date format

I'm trying to export a Data Extension via a browser download. It is not a large data extension - around 2,000 records. When I open up the exported file (a csv file), I get a mixture of two date ...
TCassa's user avatar
  • 878
1 vote
1 answer
2k views

Where i need to change the format of date and currency for german locale

I have created one quote (standard object) and that quote has product unitPrice and created date I am playing with that quote with two different users 1. BOB and 2. Alice (both have same role and ...
WantToBeACoder's user avatar
2 votes
1 answer
251 views

How to change the output format in the inline if statement of outputtext?

There are some codes like below: <apex:outputText value="{!IF(item.FinishedDate__c == null, 'Not Finished', item.FinishedDate__c)}"/> The item.FinishedDate__c is defined as Date, and I want ...
XjAcKs's user avatar
  • 23
1 vote
1 answer
10k views

UPPER case in lightning component

I build a lightning component for my org. One of my attribute is a String value inside a collection of a custom object. Somentimes this String is in lowercase and sometimes is in uppercase. I want to ...
L.benedettini's user avatar
2 votes
1 answer
9k views

how to convert string(text) to number(integer) in vf page

I am getting a field value in text format(eg :44.345). I want to use this value for division on vf page. how can i convert this to number format to be used for division
starhunter's user avatar
11 votes
1 answer
50k views

How To Format Datetime like 2017-01-10T14:53:55.000+0000?

Using Apex, how can I format a Datetime variable the same way it is displayed in SOQL result? It seems that SOQL uses the UTC format. When I run the following query SELECT CreatedDate FROM Account ...
benahm's user avatar
  • 2,627
1 vote
3 answers
3k views

dataloader csv file date format

I am using data loader to export salesforce data to csv format. In the csv file all the date and time fields are coming as like '2017-03-08T06:18:46.000Z'. Is there any way to change the format like '...
user867662's user avatar