Questions tagged [date]
A value that indicates a particular day. Unlike Datetime values, Date values contain no information about time
695
questions
0
votes
1
answer
26
views
Method does not exist or incorrect signature: void date() from the type Date
As per the title, I am encountering this issue when running an anonymous apex script:
List <ServiceContract> serviceContractList = [SELECT Id, Status__c, Status FROM ServiceContract WHERE ...
0
votes
0
answers
33
views
Change from text type to date type in Data Stream in Data Cloud
Data Stream in Data Cloud wants to create Formula Fields and convert existing text-type columns into date types.
The value of the column in the existing text format is '20231101', and we tried three ...
-3
votes
0
answers
69
views
Apex and LWC don't agree on Date being passed
The LWC is calling an APEX method that returns a list of Asset objects. It's returning a Date field. Here's what debug shows for two records:
Record 1:
"Close_End_Date__c":"2023-11-03&...
0
votes
1
answer
29
views
I need help building a date timer that relates between objects
This was my guidance for this task:
Problem:
We have Production records and Requirement (RFI) records.
We need to be able to track the 90 Days from an initial RFI Date regardless of the number of RFIs ...
-1
votes
1
answer
48
views
Automation for birthday adding contacts the day after instead the exact day
we're experiencing some issues with a birthday automation query.
Our query runs everyday and should filter contacts from 2 DE (contacts that are celebrating their birthday on that day) and put it in a ...
0
votes
0
answers
26
views
Row level formula: Pull value between two dates
I am trying to make a row level formula to identify dates that are in Q1 (Sep, Oct, Nov) of two years of fiscal data. I am able to distinguish between FY23 and FY24 using
IF(Case.End_Date__c > DATE(...
0
votes
1
answer
110
views
How to find first Monday from given date?
I'm trying to find the first Monday from a given date, and so far I've come up with the following formula, but it returns the first Monday of the month for the given date. Could you help me fix it, ...
1
vote
2
answers
54
views
Creating a due date formula based on case types with different working days
I keep getting an error message saying there's missing ")" I have seen multiple formulas using mod functions and using 1962 as start off days, and honestly when I used those in Salesforce ...
-1
votes
1
answer
28
views
Reports to cleanup
I am trying to get a list of reports that need to be deleted from Salesforce. I have created a report of reports with the below criteria.
The report seems fairly accurate and I am trying to get the ...
0
votes
1
answer
199
views
How do I subtract dates in LWC's JS?
I am developing an LWC. I want to subtract two dates and get the number of days between them so that I can conditionally render HTML based on the result.One of the dates is a field
Here's my current ...
0
votes
1
answer
74
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 ...
-1
votes
1
answer
63
views
Finding the average of dates using flow
I have a flow that creates a collection of dates of birth. my goal is to add them together and divide by the count to get the average date of birth.
the amount of DOBs in the collection can change ...
1
vote
1
answer
69
views
Flow Formula Returning Null
I have a CSV file with a Date of Birth field in the format of "MDDYY" or "MMDDYY".
I'm importing with Data Loader to a Text field, which triggers a Flow to fire upon record ...
-1
votes
1
answer
33
views
I have a requirement to check if date given on object is greater than today's but should be less than next 5 business days. How to apply that logic?
I am able to calculate easily if it is greater than today.
setConditionalFormatting(){
if(this.myTaskWrappers){
this.myTaskWrappers = this.myTaskWrappers.map(item => {
...
0
votes
1
answer
28
views
Setting Field Validation for Date Field Typo
I have a field validation for close date on the opportunity object. The goal is that the date cannot be over 4 years ago.
This date field is part of flow, and I noticed that when I did the date ...
-1
votes
3
answers
186
views
how to convert date from yyyy-mm-dd to MMM d, yyyy
I have a date as yyyy-mm-dd and i want to convert it into MMM d, yyyy in Apex. I was trying date method and converting it to string. I have today's date as '2023-07-11' and i want to return it as 'Jul ...
0
votes
0
answers
128
views
JDK Locale Format Retirement
I received an email from Salesforce informing that the JDK local format will be retired JDK Locale Format Retirement with the Spring ’24 release.
https://help.salesforce.com/s/articleViewid=000380618&...
1
vote
1
answer
222
views
LWC - render component onclick event
I have a lightning button and I have an instance of js Date class.
When I click on a button I want it to to show me a date that was week before (subtract 7 days).
Here is my .html file:
<template&...
4
votes
1
answer
226
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 ...
0
votes
1
answer
47
views
How can find no of working days between CreatedDate and one user created Date field in apex
I need to find no of working days between CreatedDate of record and a new custom field of Date.I am using businesshours to find no of working days. the issue is CreatedDate will return DateTime object ...
-1
votes
1
answer
119
views
Get time to close, instead of days
I'm trying to get a column added to a Salesforce report for case management. Using the SF Lightning experience.
There are 2 fields available currently:
Date/Time Opened
Date/Time Closed
These fields ...
0
votes
0
answers
24
views
Unable to find the correct syntax in a Row-Level Formula
Like others, new to salesforce and struggling with what is likely a simple issue, please forgive. I am working in Leaseworks, an application written on the salesforce platform. I have a column of ...
0
votes
1
answer
99
views
converting DateTime to String returns the wrong Date as a String
I have the following code to get the DateTime for EST Time Zone
Timezone tz = Timezone.getTimeZone('America/New_York');
DateTime now = Datetime.now();
Datetime localTime = now.addSeconds((tz.getOffset(...
-1
votes
3
answers
895
views
Calculate the Fiscal Quarter of a Date in a Formula Field if the FY starts in Aug
As the title suggests I'm trying to identify the fiscal quarter a CloseDate of an opportunity falls in, provided that the FY starts in Aug.
I have tried this as per document: https://help.salesforce....
1
vote
1
answer
153
views
Best practices Use == or isSameDay apex date
Currently in production I check if two dates are identical in apex by doing date1 == date2
I see in the documentation that there is also isSameDay
Would you know if using == between two dates is a ...
0
votes
1
answer
64
views
How do you write DATE() with a wildcard on year?
In my flow, I need to check whether a record's date month and day match a specific date but not the year.
So, I have a basic decision item that looks like this:
{!Record.StartDate} = DateVariable
I ...
-1
votes
1
answer
406
views
Validation Rule to Restrict date within current fiscal year?
I need help creating validation rule to restrict date between the Current Fiscal year of the company.
Say, the user should be able to only select dates between Oct 1 to September 30 of the following ...
0
votes
0
answers
520
views
"The request body is either invalid or incomplete."
I'm using the analytics studio to build a dashboard right now. I put 2 reports about campaign influence, that I created via "Reports", one for customers and one for prospects. I want to put ...
0
votes
2
answers
150
views
AMPScript: Is there an easy way to have dynamic date format based on Same Month vs Different Months?
I want to create a list of events that will show event start dates and end dates. I have a data extension that stores the StartDate and EndDates. Is there an easy way to make the date format dynamic ...
0
votes
1
answer
78
views
How to use order by clause for dates
How would you go about getting the most recent date from a table?
I've been trying to use the clause order by but I get back the following error: "An error occurred while checking the query ...
0
votes
1
answer
228
views
If a record exists with the same Date as another do not create the record
I have a Salesforce/Visualforce page which allows my user to create entries out of a list of users by dragging them onto a sudo-schedule. Once the entry is created it will display some basic ...
-2
votes
1
answer
138
views
Date Parsing In Apex
I am having birthdate like this as string 'November 1, 2012' and I want to find the age pertaining to current date.
I am trying to convert first into date as like below
Date.parse('November 1, 2012')
...
0
votes
1
answer
211
views
Converting PST time to UST TIM
I am having a time like this which is in PST Time zone '2022-12-29 08:00:00' and I am trying to convert this into UST whose output has to be as '2022-12-29T16:00:00Z'
2022-12-29 08:00:00 (PST) --> ...
0
votes
0
answers
122
views
Apex Insert Date time as it is
Inorder to book appointment in FSL I am reading the available time slots for the service resource using getAppointment REST API and here is the response from API
{
"candidates": [
{
...
1
vote
1
answer
125
views
Field Formula for Soonest Date After X Amount of Days
I'm trying to create a couple of fields to calculate the eligibility date for employee benefits.
-The first one should return a date of either the 1st or the 15th of the month 60 days after Hire Date. ...
0
votes
1
answer
257
views
Format Date from Datatable selectedRows
In my LWC I have a Datatable with a column for "Date From" - below is the column configuration
{
label: 'Date From',
fieldName: 'werDateFrom',
type: 'date',
sortable: true,
...
0
votes
0
answers
77
views
How do I put a DATE type value in a String field in a Marketing Cloud data extension
I'm trying to do this sql query, but I'm getting an error when converting the type date to string.... I've tried using CAST/ CONVERT/ TRYCAST .. but I must be doing something around because Marketing ...
1
vote
0
answers
412
views
Calculate Salesforce Case response time
I'm new with salesforce formula and I have this requirement to compute the business hours with mins. in salesforce case.
what i did is that i set-up one field in case objects (data type = formula). ...
-2
votes
1
answer
114
views
AMP Script - Populate last date of the third month in DD-MM-YYYY [closed]
set @todayUS = Now(1)
set @tomorrowUS = DateAdd(@todayUS, 1, "d")
set @yesterdayUS = DateAdd(@todayUS, -1, "d")
set @threeMonthsDate = dateadd(@today, 3, "M")
set @month =...
-1
votes
2
answers
43
views
Error in date class
I am tr4ying to concatenate two date fields. But I'm getting this error: "Date expressions must use Integer or Long"
eg: System.debug(date.today()+date.today());
1
vote
1
answer
54
views
Date.parse parses weird dates with no typeException
Date.parse('30/30/2019') works different in sandboxes. Everywhere typeException is thrown as expected, but in one sandbox this date is being parsed into 2021-06-30 00:00:00.
I checked everything - api ...
1
vote
1
answer
87
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 ...
9
votes
1
answer
269
views
Winter 23 - ICU date Formats - Date.parse
I have observed in the last few days the following (locale = en_US):
Date d = Date.parse('15/56/2023'); // run with api V55
System.debug(LoggingLevel.INFO,d);
Environment ICU enabled? ...
-1
votes
2
answers
423
views
Can I set the field CloseDate on Opportunity to null or blank?
I know that I can use some workaround like that:
opp.CloseDate = Date.valueOf('1900-01-01');
But is there a possibility to have that field not visible for some (cloned) Opportunities? (beyond hiding ...
-1
votes
1
answer
1k
views
How to get start and end date of a specific quarter
I'm looking to update the start date & end date of the specific quarter based on the year and quarter fields selected by the end user. I thought of trying with the Period object but I'm unable to ...
1
vote
1
answer
112
views
Remove time stamp from a Salesforce Field in Marketing Cloud
I do want to remove the time from a Salesforce field retrieved from the object CampaignMember.
I had tried this the following amspcript code in my email but I do still have errors to send it :
%%[
VAR ...
0
votes
1
answer
653
views
Report Filter Date
I am looking to filter a date to show appointment dates for only this month to todays date (so not the entire month). Is there a relative date formula i can use for this?
Thanks
-1
votes
1
answer
98
views
convert kafka epoch date to normal salesforce date
I am receiving events from kafka which has logical type date fields
"FirstDate": 37367,
"LastDate": 86367,
I am trying to convert it salesforce appectable format like below
cont....
2
votes
1
answer
934
views
Is it possible to use a date range as map's key and then use a date to find the entry?
I have a list of records that map to a particular date range. For eg:
1 Jan 2020 - 31 Dec 2020 -> Toyota, Aston Martin
1 Jan 2021 - 31 Dec 2021 -> Red Bull, Mercedes, Ferrari
1 Jan 2022 - 31 ...
0
votes
2
answers
897
views
SOQL to get all records with in a given date range
Below is my sample data:
I am trying to form a query where I can get records within a date range.
Date Range is start of the week to end of the week. For example I want all records that falls between ...