Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [date]

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

0
votes
0answers
16 views

“INVALID_TYPE_ON_FIELD_IN_RECORD” while updating date/dateTime field using SOAP client

I have a SOAP client which connects with Salesforce and do CRUD operations. Earlier I used to use Axis to generate stub and in that case it works perfectly but then I replaced axis with force-wsc due ...
-4
votes
0answers
48 views

Test class is not able to cover the usecase [duplicate]

Currently, I'm working to send a survey link to the account owner. whenever devices have been shipped from the case. I need to create a training case & need to send a survey link to the account ...
0
votes
4answers
62 views

SOQL with Date filter in WHERE clause

@AuraEnabled public static List<StaffReport__c> getUserReports(String UserId, Date startDate, Date endDate) { return [Select Date__c from StaffReport__c where User__c =: UserId AND Date__c &...
5
votes
2answers
148 views

DateTime.addMonths skips a month (from feb to mar)

I'm writing some code to get each months name between a start and an end date. This works fine for most months - except February into march, and november - december. Heres the code : Date startDate ...
0
votes
1answer
25 views

Missing date operators in the entry criteria

I am creating a Salesfore Data entry source in a Journey. In the second step 'Entry Criteria' I have to apply a filter based on a date field 'XXX is greater than 'Today' plus 4 days' That ...
0
votes
1answer
25 views

Date Formula field help

Good Day, Would like to request assistance on a formula. I am trying to capture the Day & Month of a field called Contract_Start_Date__c and then add the year today. For instance Contract Start ...
1
vote
2answers
107 views

How to retrieve the correct Account records from SOQL query?

In account record I have a custom myDate__c field of type date. I need to retrieve all Account records where myDate__c is older than 45 days. I've tried with the following query: SELECT id, name ...
1
vote
3answers
94 views

Is DateWithin30Days(Date 1, Date 2) an Apex Method?

I'm working on the #APEX Unit Testing unit on #TrailHead, and I saw what appears to be a very useful Date method, DateWithin30Days(date1, date2) This would be very useful for some of my projects, but ...
-1
votes
0answers
12 views

How to compare a datetime field with TODAY() date [duplicate]

I have a datetime field in Salesforce which is Checkin_Date__c. I want to check if Checkin_Date__c and TODAY() has 60 days of difference. I am trying to do this: DateTime dT = Checkin_Date__c; Date ...
0
votes
1answer
33 views

How to override user's locale for toStartOfWeek() method, so that system should always return Sunday date as week start date?

Date currentDate = System.today(); System.debug('Start of week = '+currentDate.toStartOfWeek()); For English (United States) locale System.debug will display Sunday date as Start of week. And for ...
0
votes
1answer
38 views

String parse to Date yymmdd

I wrote a question below : String parse to Date yyyymmdd But now I'm facing a new similar question : What if I want to parse a string yymmdd to a date? for example : 190503 instead of 20190503. ...
7
votes
1answer
88 views

Set collection doesn't always enforce uniqueness with the Date datatype? Does the following example seem correct?

Consider the following unit test: @istest public static void datetests2() { Set<Date> dts = new Set<Date>(); dts.add(DateTime.now().Date()); dts.add(DateTime.now().addHours(1)....
0
votes
1answer
50 views

String parse to Date yyyymmdd

I need to parse a string that I got from a json to date while the value of the string is in the next format: yyyymmdd - for example 20190429. Is there another simple way to do it instead doing ...
0
votes
1answer
83 views

Same Date, self reference? Work-around ideas

I have got a lot of research and recherche done as this simple where clause doesn't work because of it self-reference. I want to display all leads and opportunities who have the same "datefield x" as ...
0
votes
1answer
50 views

Business Hours calculation is incorrect/ not consistent for certain dates

My use case is to calculate the deadline to respond on the Case. Rule is to add 10 business days from the complaint received date. Defined the business hours: Logic 1 Date initialDate = ...
0
votes
1answer
67 views

Apex Date Parse Invalid Date in IE11 - Valid In Chrome

I have a string searchStartDate coming from an input field on a VF page. The input is 03/20/2019 Once passed to the apex controller I debug the string before parsing it. In IE11: 08:02:13:041 ...
0
votes
1answer
96 views

<lightning:input type=“date” validation

I need to put a validation on lightning input field date. It is a date of birth field and it should not accept date beyond system.today(). Basically the validation will be date_Of_birth > Today() , ...
0
votes
1answer
41 views

Issue with apex:input datetime

I have a page where a patient enters the appointment date for consulting, I m showing a dateTime input fields as <apex:input type="datetime-local" value="{!appointmentDate1}" styleClass="bRadius ...
0
votes
1answer
23 views

What is wrong with my Date/time Process Builder Formula based on a Date field without weekends

I have a Task Process Builder based on Opportunity Stages. I am trying to create a formula for the date time due field based on a date field (Internal Deadline). I need the formula for the Date Time ...
0
votes
1answer
54 views

How to send date from web to lead to datefield salesforce

I try to pass a date from a web2lead form to a date field, but the field stays empty. Travel date in: <span class="dateInput dateOnlyInput"> <input id="00N1t00000K2yXV" name="...
0
votes
1answer
24 views

Converting a String to a Date with Date Format YYYYMM

I kind of stuck on this one. Basically, we have a string that is actually a date with a format YYYYMM. For example, 201901. I wanted to convert this into a date record, but I found out that we could ...
-1
votes
1answer
24 views

Show Date selected in Filter in separate text boxes [closed]

There is requirement to show Date range selected in seperate text boxes. For example if i have a Select list filter for Dates and i have selected date range between 01/01/2019 and 12/01/2019, i also ...
0
votes
1answer
75 views

How to separate The Day, Month and Year attributes using SQL _Open query in salesforce marketing cloud?

I have creating TestDE Data extension using these attributes like SubscriberKey, AccountID, EventDate, Date, Month, Year attributes. And Created with same attributes using Target Data extension. Now ...
0
votes
1answer
291 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 ...
0
votes
1answer
34 views

How to add only business days

I have a problem with adding days when creating Task. I have a simple apex code newTask.ActivityDate = Date.today().addDays(5); But what i need to do is to count only business days. Thanks for any ...
0
votes
2answers
132 views

Convert String Date to Date in Apex

I am using an SOQL in a webservice that is querying the Contact object based on the BirthDate field. The webservice request has the date in the format of 'yyyy-MM-dd',i.e.,1962-01-29 as an example. I ...
0
votes
1answer
21 views

How to display Date time field without showing the 00:00:00 Time when we reference it in the Apex code?

We have a S-control button which sys SendAttendancelist. The S-control calls the apex class Classobj in that we have a email that is sent out from apex while executing it sends out email with few ...
0
votes
1answer
247 views

String ('yyyy-MM-dd') to date using date.parse returns ('yyyy-MM-dd hh:MM:ss')

I am trying to output a date type with the format yyyy-MM-dd, but. not as a string type. I can create the string just fine. // First I output 2018-12-01 00:00:00 as a date currentDate = Date.today()....
0
votes
1answer
159 views

Calculate time difference between two date time fields

I have a process builder by which I am calculating the time difference between NOW() and another Case object date field. My formula goes like this Time_Spent__c = NOW() - Start_Time__c However ...
0
votes
1answer
108 views

How to get server's current date in lightning component without using apex

I have a lightning component that checks if a field date has passed the current date. The problem is that the current date is based on javascript new Date() object, so the user can change the date on ...
1
vote
1answer
40 views

Optional webService parameter in apex

I have a apex webservice with "data structure" made of webService attributes. In request data, i have: global class GetRequestData{ webService Date From; webService Date To; webService ...
0
votes
1answer
138 views

Wrong date when converting datetime value to date field

I am using the REST API for creating a new Task record, including an Activity Date in the format YYYY-MM-DDThh:mm:ssZ. My current timezone is UTC+1. When submitting a date in the first hour of the ...
1
vote
0answers
105 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 ...
2
votes
1answer
58 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-...
0
votes
1answer
75 views

How to check date field with set of dates?

I have list of dates and I have stored them in a set. List<Account> a=[select id,duedate__c,overduedate__c from account]; Set<Date> sdate=new set<date>(); Set<Date> s1date=new ...
0
votes
3answers
45 views

Formula field value for old records and another value for new ones

I have formula fields which calculates the net value and total value for sales order object, I want to change these formula fields values but not affect the old value for sales order which is packed, ...
1
vote
1answer
28 views

Set Text 'Not Attempted' in Date field

Is it possible to input a default 'text' to a Date Field. which will change to a date as soon as the person attempts something
1
vote
1answer
27 views

Assigning operators for Date fields and comparing with today(), Scheduled Apex Code

Exam_Date__c = 01/01/2018, Expiration_Date__c = 01/31/2018 (usually 30 days gap) I want to send an email 7 days prior to expiration, on say eg. 01/25/2018, likewise. I used the following formula in ...
0
votes
1answer
32 views

Business day formula help

The use case: I am trying to calculate a date that is 3 "Bank Business days" after the application create date. Which includes Saturday and not Sunday. The Below Formula is taking into consideration ...
1
vote
2answers
568 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
2answers
295 views

How to pass Date dynamically to newInstance method of Datetime

i want to pass date into newInstance method of datetime class then i will get date of week.when i have given static date it's working fine but when i try to pass dynamically i am getting error please ...
0
votes
1answer
34 views

Anyone know how to remove/hide the [ 00/00/0000] Date from the date input field?

I'm just wanting to hide/remove todays date at it serves no purpose in my form any idea how I do this?
0
votes
1answer
63 views

DLRS - SOQL Error and returning text

I am trying to create a rollup field using the DLRS tool. However, I am running into multiple problems. Ideally, I would like to have my field find the most recent activity date and return the ...
1
vote
2answers
33 views

Looping through all entries using a Primary_key, Validating and Updating the corresponding field Values

Exam is an object. It contains the following fields - exam_name(String), exam_state(picklist), exam_date(date), expiration_date(date) 'exam_name' is an AutoNumber(string) field (starts from 1 and ...
0
votes
3answers
2k 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?
0
votes
3answers
419 views

Merge Date & Time field in to datetime field using formula field

We have to separate fields to pick appointment date & appointment time in Custom object. Now we have to filter out appointments between two dates (w/ time), so I need to compare appointment date &...
1
vote
1answer
45 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 ...
3
votes
1answer
75 views

Why Datetime and Date class don't have more parse options for various Datetime/Date string formats

From documentation: Date Class: parse(stringDate) Constructs a Date from a String. The format of the String depends on the local date format. Datetime Class parse(datetimeString) ...
2
votes
1answer
914 views

How to properly handle dates returned from REST API

So it appears that when returning a DATE field from the REST API, that salesforce does NOT convert it to UTC (Doesn't return any time-zone information, just a YYYY-MM-DD string. Instead it returns ...
0
votes
3answers
69 views

How do I set a project end date to be 6 months out from the start date?

I created a custom field called Start_Date of type date. I created another field called End_Date that I would like to default to Start_Date + 6 months. But whenever I try to do this in a formula I get ...