Questions tagged [date]

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

Filter by
Sorted by
Tagged with
-1
votes
1answer
72 views

Salesforce Date field (add a month/31 days but cannot end on weekend)

I have two fields in a particular opportunity. One is the "Proposal Sent Date" which is automatically entered when the user generates the proposal (via Conga Composer). I also have the "Proposal Valid ...
2
votes
1answer
945 views

invalid date - When changed date format from US to UK

I need some help with switching the format from DD-MM-YYYY or MM-DD-YYYY to ISO Standard (YYYY-MM-DD)in JavaScript. I'm using this on a custom URL Button. This is what i'm doing, and It is working ...
1
vote
2answers
98 views

Convert a number picklist to date field & send email on that date before

I have a picklist with values from 1 to 31.It corresponds to the date. My requirement is to convert this number selected to a date. Lets say the number selected is 20 then it has to correspond to 20th ...
9
votes
1answer
4k views

How to pass Date from Lightning to Apex

In Lightning component I have attribute and input for date: <aura:attribute name="myDate" type="Date"/> <!-- ... --> <ui:inputDate aura:id="my-date" labelClass="slds-form-...
0
votes
2answers
493 views

Problem with date when uploading a csv via DataLoader

I'm having an issue when uploading a date from a csv via DataLoader. The date on my csv is for example 2017-04-03, but when uploading it via DataLoader, it will be 2017-04-02 in SF (always one day ...
3
votes
1answer
667 views

Get Difference Between 2 Dates in Months Without Exceeding 5000 Characters

I am trying to determine the variance (in months) between an actual date and a planned date. The actual date can be either before or after the planned date, and this is what is making this difficult. ...
5
votes
1answer
2k views

Date.newInstance() bug?

I was having issues with a method that was repeatedly printing out wrong dates, when I executed this in anonymous apex Date foo = date.newinstance(2016, 27, 7);//year, month, day system.debug(foo); ...
3
votes
1answer
1k views

How to prevent manual entry in ui:inputDate

I have used <ui:inputDate> for entering date as follows: <ui:inputDate aura:id="ValidFrom" label="Valid From" class="slds-input" labelClass="slds-form-element__label" value="{!v.ValidFrom}" ...
0
votes
0answers
5k views

Check if Date field is empty

How can I check if a Date field is empty or blank? I tried this statement: if(project.Current_Launch_Date__c==null) But I don't get the desired result, even if I delete the date value, it still does ...
0
votes
2answers
260 views

Trigger workflow n hours before a date field

I am trying to schedule a workflow to send an email alert 52 hours before a class starts. Class is held at the same time every day (2pm) it's offered and therefore class_date was set up as a Date ...
0
votes
2answers
71 views

Help with formula field

I have a custom object called Project. Within this object I have two important date fields – Finance Expiry date (Finance_Expiry_Date__c) and Contract Expiry date (Contract_Expiry_Date__c). These two ...
0
votes
2answers
593 views

Show dynamic content block based on date and last update

I have created a dynamic content block, which is meant to be added to our email template. It is a top banner, which should only be shown if a customer have made updates to their basket within the last ...
6
votes
1answer
12k 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 ...
3
votes
1answer
78 views

Custom Case Change Due Date button

I'm trying to create a button that would change the Due Date field of a selected case in a List View. I'm stuck on the URL, since this is a mass change type would there be a custom URL that would be ...
0
votes
4answers
708 views

Apex: How to generate List of all Friday Dates for given month

I am trying to create a List of date type which contains every Friday of the month in it. So for example, for the month of March, the list would contain the dates of March 3rd, 10th, 17th, 24th and ...
1
vote
3answers
1k 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 '...
1
vote
1answer
79 views

Opportunity CloseDate timezone in Apex/SOQL

I'm currently running a batch Apex job every day that processes payments for all Opportunities due to close on a given day. This is working fine, but we are soon expanding into other timezones, and I'...
3
votes
1answer
1k views

How to insert/pass NULL value into Date field

I am trying to insert a null value into a field of type Date (in SalesForce) using a PHP Script. Here is my logic. $Date = '', $createField['Date__c'] = $Date; I tried the following, but none of ...
4
votes
2answers
31k views

How to set a Date in apex test class?

I have written a test class in which I just want to set one date field. How can I achieve this? I am not able to set the value using the following code: Account acc=new Account(); acc....
0
votes
1answer
50 views

Formula to create values: FYnn when fiscal years not on calendar boundaries

I'm creating a custom campaign naming convention and I need one part of the IF statements to return a fiscal year text value equal to "FY17","FY18", etc. So, the logic is: If the date is between 7/1/...
0
votes
2answers
158 views

Validate Datpicker Value

I have a Datepicker field in my VF Page <apex:pageBlockSectionItem > <apex:outputLabel value="Dealer Purchase Date"/> <apex:outputPanel styleClass="requiredInput" layout="block" ...
5
votes
1answer
2k views

Lightning Component - pass variables from component to apex & get result back

I'm trying to pass a date field from a component to apex class and then return a string to my component. But I can't figure it out. Here is the detail of my code : lf_reports_controller.apxc ...
0
votes
2answers
260 views

Can I use a formula to find total opportunity value of years past in a workflow?

I want to build a workflow around the following: (Total $ value of opportunities in the current fiscal year > $1000 OR Total $ value of opportunities in the past fiscal year > $1000 OR Total $ value ...
1
vote
2answers
1k views

ComputeExpression Date Formatting

Trying do do a basic ComputeExpression with a date type that picks one of 2 dates using a case statement. Dataflow fails on the ComputeExpression step with this error message: expression data ...
1
vote
2answers
839 views

Time Based Workflow on date field to consider week-days only

Is there an easy way to add functionality to an existing time-workflow rule that doesn't send email alerts at the weekend? At the moment it send out email alerts when a lead hasn't had any activity ...
0
votes
1answer
163 views

SOQL for records in a 7 day range?

I'm facing a problem in figuring out a SOQL query for the following scenario. There's an object say X with a custom date field Start_Date__c. Now, I want records belonging to X with start date till 7 ...
5
votes
2answers
802 views

replacing LAST_MONTH

I have some code that depends on LAST_MONTH. Something like: select .... date__c .. FROM myTable__c where date__c = LAST_MONTH This code, as I understand, returns a result set constrained to ...
0
votes
1answer
477 views

Visualforce Email Template Subject Date Extraction From DateTime field

I need some help and i am a little confused. I have the following field Delivery_Date__c which is the datatype of Date/Time. I know i can extract the date and time separately within my email body, ...
0
votes
1answer
227 views

Query Next Two Dates in Data Extension

I have a data extension which contains future dates in column 1, then column two has their day of week, column 3 has a specific time of day for each of those dates. In my email, I need to pull in the ...
1
vote
0answers
188 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 ...
0
votes
1answer
2k views

Getting Desired DateTime format in Visualforce Email Template

I'm currently making a making a visualforce email template and I'm having a problem with displaying the desired output format. I have a field, Opportunity.Start_DateTime__c with DatetTime format. Ex....
0
votes
1answer
294 views

Date format is not the same in Chrome and Explorer

I printing out a date field, and normally the format is based on the user local setting (i am using french settings). the problem is that in chrome browser, the format is correct 'DD/MM/YYYY', but in ...
3
votes
1answer
2k views

Illegal assignment from Datetime to Date

I am trying to map a custom object's CreatedDate to another custom object's custom date field. But I am getting this error: Illegal assignment from Datetime to Date I am doing something like this:...
0
votes
1answer
52 views

Datepicker in Salesforce - Year

So as part of inbuilt validation , if we enter 8/8/17 ---> Salesforce converts it to 8/8/2017 Similarly , if we enter 7/8/88 --->It becomes 7/8/1988 This occurs before SFDC code is even invoked . ...
0
votes
1answer
380 views

Date Validation in Visualforce/Apex without JS [duplicate]

For a date field , I know I can put validate like this : <apex:outputText label=" Date" value="{0,date, MM'/'dd'/'/YYYY}" > <apex:param value="{!item.Date__c}" /> ...
-2
votes
1answer
9k views

How to get the date value of current date?

I want an if condition that could check if the day value of the current date is 1. I have applied the logic: if(Date.Today().month()==1) But the above results in months. How can I check for days ...
2
votes
2answers
518 views

Does System.today() change within a single transaction?

I would assume that every call to System.today() produces a realtime answer, meaning if you call it at 23:59:59, it will produce a different answer than if your code runs for another second and calls ...
0
votes
1answer
123 views

Wrong date Apex error message

i want to make an this.addError with a condition on a date field this condition must get the error if the date is write in a wrong way like this: 19/13/2017 i have already an if condition in this ...
1
vote
1answer
11k views

Datetime to Date to String

Datetime Createddate = system.now(); Datetime Duedate = Class.Method(Createddate,10); //Converting to date format Objinstance.Field__c= Date.newinstance( dueDate.month(), dueDate.day(),dueDate.year());...
0
votes
1answer
591 views

How To Convert result into Date in Javascript?

public class MyCustomController1 { public class studObjectwrap {public String D_ob{get;set;}} @RemoteAction public static String createRecord(String jsonObjResult){ //Some Code od Json ...
1
vote
3answers
1k views

Apex: Getting the number of milliseconds in a date field

Is there any way to get the number of milliseconds in a date field as either a String or Integer? So I pass 1000000000 into the date field, I dont want the date that represents, I want that number.
2
votes
1answer
797 views

Relative date range in reports filter

I am trying to generate a report for my end user based on date range. I used the filter in reports e.g. Issused date greater or equal 01/01/2016 (start date) AND Issused date less or equal 31/12/...
1
vote
1answer
315 views

How to create an Automation Studio exclusion AMPScript to filter the users of the last hour?

I would like to send an email to the users of my Exact Target list after a certain amount of time. In order to do this, I set up a workflow in Automation Studio with a Send Email task. Inside the ...
0
votes
3answers
2k views

Add days to created date excluding weekend and holidays

I have written the following code . But it's not giving result nor any error. My requirement is to add 3 days to CreatedDate, excluding weekend and holidays. Datetime createdDate = system.now(); ...
0
votes
1answer
13 views

Generate “Report Export Date” Value on a Report and Associate Value with Each Record on Report…Feasible?

Is there anyway to populate the date or datetime a report is exported within a report...a field value that will be associated with every record in the report? For instance could i use the a field ...
1
vote
1answer
35 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 ...
0
votes
1answer
40 views

Formula for assigning a value to all working days between 2 dates

I am logging Sickness in salesforce and have a start and end date. For reporting purposes i need to be able to assign a 1 to each of the working days between these 2 dates. Then when i report i can ...
1
vote
1answer
27 views

What other parameters does Date.parse(str) accepts other than str = 09/09/2018?

I was testing Date.parse(str) method with following types of inputs: String str1 = '06/06/2016' String str2 = '06-06-2016' String str3 = '2016-06-06' String str4 = 'July 6th, 2016' String str5 = '06, ...
-1
votes
1answer
70 views

Apex Trigger is not working appropriately on mass updating records

Hi friends i got a requirement to revenue loss field in case wth specific record type and condition and i need to update based on account and other object with lookup to account based on criteria. ...
2
votes
4answers
964 views

SOQL Error in Compare Date

Could you please help me for fix my SOQL Query? I have SOQL Scrip like : SELECT Employee_No__c FROM HREMPASSIGNMENT__c WHERE Payroll_Name__c=:selectedPayrollName AND Payroll_Name__c != null ...