Questions tagged [date]

A value that indicates a particular day. Unlike Datetime values, Date values contain no information about time

99 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
2answers
1k views

Storing 'date' attribute for ExactTarget subscribers

I've been trying to store 'Date' via API, but somehow it doesnt work I have created new field in profile management, called 'prospect_date' If I create new subscriber, pass all attributes via API ...
3
votes
0answers
307 views

Moment JS but for Salesforce Apex

Are there any open source libraries similar to Moment JS but for Apex? Reference: Moment JS
2
votes
0answers
33 views

Get # of days for week number X

Is there a way to get the total days or hours of each week of a month? I am using WEEK_IN_MONTH() to get the week number but now I need something like HOURS_IN_WEEK() or DAYS_IN_WEEK() which I can ...
2
votes
1answer
125 views

Adding days and then business days to a datetime field

Here is what I am attempting to do. I have a date on a custom object Deal__c. The date is Asset Management Close Date (Asset_Mgmt_Close_Date__c). The sidecar__c object is created with a master-...
2
votes
1answer
43 views

Creating and re-selecting SObject has different results

I have this simple bit of unit test code as below. It uses a Job_History__c custom object which has a master-detail relationship to another custom object, Employment__c. The Employment__c object has ...
2
votes
0answers
668 views

ERROR(Save Error: duplicate Alias: Name) when using Day_Only

I'm using the following SOQL query to populate a custom controller for our sales team to view their opps on the opp tab landing page. It works fine with CloseDate alone, but the field is returned as ...
2
votes
2answers
978 views

DatePicker Issue

I have two text field: One normal text field that accepts numbers. <apex:inputField value="{!FinancialAssCont.Down_Payment__c}" styleClass="form-control downpaymentAmount" onblur="...
1
vote
1answer
22 views

How to filter on CreatedDate using a date range in SOQL?

I'm having problems trying to filter a query by CreatedDate using a date range. The query returns always a wrong set of records. For example, if I want to get all records created until 2020-07-28, it ...
1
vote
0answers
30 views

lightning input type = date, max attribute behaviour not similar in production and lower enviornment

I used max attribute of lightning input type date to disable the future dates in date picker. It was working in lower environments, but not working in production. In Lower Environments: It shows the ...
1
vote
0answers
16 views

Is Salesforce Advanced Formula Example for Business Days Incorrect?

Throughout the year we have been using the following formula field from Salesforce Advanced Sample Formula to calculate the number of business days: This is recommended on the Salesforce Website ...
1
vote
1answer
54 views

lightning:inputField type Date showing both Date Picker and history of dates, how to avoid showing history but show only the Date Picker?

I am using lightning:inputField with type as Date, the issue is this field shows two pick-windows 1. Date Picker and 2. Date-History picker. Please help anyone, if you know if there is any fix for ...
1
vote
0answers
41 views

AMPscript Dynamic Date MobilePush Message

Is it possible to reference a date attribute of a particular push message? As in something like: %%[ VAR @messageCreatedTime SET @messageCreatedTime = MessageCreatedTime ]%% Inbox Subject Line: %%=...
1
vote
0answers
250 views

Salesforce Contracts - Testing on Contract term/End Date

I have a class that is looking for contracts 30 days before the end Date. My problem is i am trying to build a test for this class, and in that i'm trying to create a contract where the End Date is ...
1
vote
1answer
66 views

BusinessHours and scheduled dates

I am trying to create a payment schedule off of a input field DATE. If the date falls on a Weekend or on a Holiday then I want to move the payment date to the next open business day. I was using the ...
1
vote
0answers
185 views

How to Calculate the CreatedDate Day of the Week In Process Builder

I've been trying to determine in process builder what date of the week the created date is but I keep getting an invalid formula error without details on what is incorrect. If I try either of the ...
1
vote
1answer
49 views

Popup window to remind users to change event start/end dates

I want a reminder window to pop up in Salesforce after a user creates an event and clicks save. Sometimes users forget to change the event start times/dates so I want the reminder to just say ...
1
vote
0answers
85 views

For date field type in salesforce wave analytics, internally many sub fields for date gets added. What can i do to get only the field that i provide?

For example i have a date type field as ClosedDate in the external CSV file that i need to upload to create a dataset, when i try to see the fields, internally many sub fields gets added as follows: ...
1
vote
0answers
505 views

How can I establish schedules on opportunity products (with daily installment period excluding weekends)?

Background: Under Opportunity tab, I will go and create a new Opportunity. In the Opportunity Detail, there should be a button to add Product When adding new Product, I click the 'Establish' button ...
1
vote
0answers
266 views

Export Report data using a specific Date format?

I have two date formats in my Org. We have to use it that way, but I would like to be able to convert to one or another when exporting to xls. Is there a way to tell SF to create export in specific ...
1
vote
1answer
44 views

Report Grouping by Date

I'm relatively new to SF but gaining steam quickly. I've got Opportunities that include a contract start date and contact end date and I am trying to create a report that summarizes who we have ...
1
vote
1answer
237 views

Difficult SOQL query for Id between dates

Can anyone help me? Can I realize in soql query next fetch: I have a map Map< Id, List< List< Date >> (List< Date > consist of two values: StarDate and EndDate). For example I ...
1
vote
2answers
105 views

Task ActivityDate - Behaviour in Visualforce

For a number of apex:inputfields in Visualforce, I'm suppressing the Salesforce date picker and using the browser based one. I'm experiencing odd behaviour when attempting to do so on the Task ...
1
vote
1answer
147 views

Why Custom Date field displays Year value till 2021?

I have created a field "Test Date" of type date on opportunity object. On Opportunity Record when I want to provide date value(year) as 2022 or 2023,it displays list of years till 2021. Scenario:when ...
1
vote
0answers
916 views

Different default date formats within flow

I'm using a visual workflow. If I enter current date as the default value in a text field, then it will show up mm/dd/year. But if I put the date in a formula field I get year-mm-dd. Sometimes I am ...
1
vote
1answer
64 views

Bug in Salesforce Day calculation for a date if hours is 0?

Does Salesforce have a bug in the day calculation logic if the hours is 00? May 9th 2016 is a Monday. But Salesforce always returns Sunday. I guess when the hours is 00:00, its considering it as ...
1
vote
0answers
570 views

Getting Custom Fiscal Month and Year from Calendar Date

We have set up a custom fiscal calendar in Salesforce using the standard Fiscal Year functionality located within Company Profile. Within an Opportunity, I want to convert the close date (which is a ...
1
vote
1answer
22 views

Salesforce : Get ActivityDate associated with an object

I am writing a program to fetch the 'ActivityDate' associated with an object on a class. Below is the code that I used. But I am not sure, how to fetch it in a variable. List<Pt__c> partc= [...
1
vote
0answers
36 views

Converting American Date format to a Date Using a Formula

I'm converting an American Date format string to a Date using the following Formula. For example, this will convert a String like "9/25/2015" to an actual Date field that can be used in reports, list ...
1
vote
0answers
106 views

Convert Date to Datetime Formula

I need to convert the following formula to DateTime based. Can you assist? IF(C1_Date__c = TODAY()-1, 1, 0) + IF(C2_Date__c = TODAY()-1, 1, 0) + IF(C3_Date__c = TODAY()-1, 1, 0) + IF(C4_Date__c = ...
1
vote
0answers
49 views

Change date from 12-31-2015 into 31-Dec-15

How can I change the format of the date from the format of 12-31-2015 into the format of 31-Dec-15? Is this even possible in salesforce? As much as possible I want to avoid coding. Thanks in advance. ...
1
vote
0answers
94 views

Determining due date (with hours) with Start date, length in hours and business hours in salesforce formula

On the case Standard object, i would like to determine the due date when the case is created. Business hours is active (9AM to 6PM, monday to friday, no exception, no holiday),and i've got Different ...
1
vote
0answers
80 views

Inaccurate count of weekdays for the month of March

Is there a reason why counting the days of the month of March is inaccurate? This is the method in counting the weekdays: public integer GetWeekDays(Datetime startDatetime, Datetime endDatetime) { ...
1
vote
0answers
55 views

Standard DatePicker always set empty

We have some date fields in VF pages which were working fine. Suddenly some of them are not working. When user select the date from date picker, always it sets empty string to the textbox. ATM don't ...
1
vote
0answers
1k views

Date and Number locale problem on html5 input type=date/number

Question Is there any chance to send data in generic date format (yyyy-mm-dd) in standard save method? I need to user apex:input type="date" (or number). But Salesforce save method is not ...
1
vote
1answer
120 views

Getting date in salesforce case

I am a bit new to salesforce. I have made a web to case form that I have to use on goolge sites. I have made the HTML data picklist for day, month and year. How can I get all these three in salesforce ...
1
vote
4answers
2k views

Formula Question: Record a date of first activity on contact object

I need to create a custom field on my Contact object that records the date of the very first call that has happened with a Contact record. I thought about creating a formula field on Contact, and ...
0
votes
1answer
16 views

How to remove the time 00:00:00 from a date format and still maintain the date type

PROBLEM: I converted a string to Date format. Eg: String dateToParse = year+'-'+month1+'-'+day; Date ds = Date.parse(dateToParse); OUTPUT: 2020-07-24 00:00:00 (output is a Date type variable) Expected:...
0
votes
0answers
16 views

How to Blank Date value in Date formula field?

This field is to display the "date" value when this Opportunity's Stage value contains "Closed ". and at the same time Opportunity's Stage value not contains Closed means this ...
0
votes
0answers
46 views

System.now() gives different value than expected?

For example if DateTime is : DateTime dt= Datetime.newInstance(2020,07,12,18,30,0); //using System.now() for dt DateTime.newInstanceGmt(dt.date().addDays(-5),Time.newInstance(00,00,01,00)) ;// should ...
0
votes
1answer
12 views

How to put filter in report for dynamic last month?

I am trying to filter out records in my salesforce report like i just want to see last month records (Created Date). See below what i have done so far, Date filter on Created Date > CUSTOM > 02-...
0
votes
0answers
29 views

Reset invalid value in lightning-input date to a blank value on click of a button

I have a lightning-input of type date. When I enter an invalid value in this field, there is a validation displayed 'Your entry does not match the allowed format MMM d, yyyy.' I want to clear this ...
0
votes
1answer
57 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]...
0
votes
0answers
12 views

I need an “always up to date” ARR value in my accounts, based on opportunity values and dates

Hello Salesforce people, I have something I am trying to do in Salesforce, and I am coming up on a lot of limitations within the platform, and I wanted to ask the best way to do what I am trying to ...
0
votes
1answer
29 views

Why does dateGmt() function contains a Time quotient at all?

Long startTime = 1112222220; Date startDate = DateTime.newInstance(Long.valueOf(startTime)).dateGmt(); system.debug('startDate: '+startDate); String qry = 'Select Id, Subject from Task where ...
0
votes
1answer
39 views

THIS_QUARTER is breaking SOQL query

I have a very bizarre issue with a batch job that is using the following query as a scope to generate new records Select id, Management_Fee__c, Payment_Schedule_Comments__c, ...
0
votes
1answer
68 views

ValidationError (Invalid Date) when importing a CSV to a Data Extension with a Date type field

I have extracted the _open Data View from an old instance and tried to import the 139K CSV records into a Data Extension in the new instance. However, I got a problem with the "EventDate" field when ...
0
votes
0answers
12 views

Date based entry event not working

I've set-up a data based entry event as can be seen in the picture. When I run a similar query it gives me the people who have their birthday today. But the entry event is not doing anything, it is ...
0
votes
0answers
6 views

Import English (UK) dates into Marketing Cloud

I am trying to import a CSV with a bunch of customer information into Marketing Cloud. The import keeps failing due to Invalid Date: 7. I've been using English (United Kingdom) as the date format ...
0
votes
1answer
23 views

Date Field - Timezone Issues in Batch Job

I'm seeing peculiar behaviour on a Date field (not a DateTime field) when we utilize these date fields in a batch. For instance using the code below: endDate = Date.newInstance(startDate.Year(), 6, ...
0
votes
0answers
18 views

SOQL queries with date literals

I am trying to send a SOQL query to salesforce using jsforce. I would like to select all opportunities that are closing within the next year. I firstly tried to use a javascript date but I get an ...