You need to sign in to do that
Don't have an account?
Taylor Friss
How do I convert Last Transfer Date to a date value?
I am trying to use the Salesforce default Lead field called "Last Transfer Date" as a date field. It is displayed as a date field, but after doing some testing with formulas it appears to secretly be a date time field.
When I use DATEVALUE(LastTransferDate) I get an error of:
Error: Incorrect argument type for function 'DATEVALUE()'.
My end goal is to use TODAY() - LastTransferDate to calculate how many days a Lead has been in a users name.
When I use DATEVALUE(LastTransferDate) I get an error of:
Error: Incorrect argument type for function 'DATEVALUE()'.
My end goal is to use TODAY() - LastTransferDate to calculate how many days a Lead has been in a users name.
CloseDate is already a date value, and does not need to be converted. Also, your formula is effectively an "#Error" value, because you can't divide by zero (X - X = 0). You'll need to adjust your algorithm.
We calculate days between close date and today, and divide by the number of days from the created date. We subtract from 1 to "invert" the value.
Thank You,
www.nubeselite.com
Development | Training | Consulting
Please mark this as solution if your problem is solved.
You can change your field 'Last Transfer Date' on Lead to date like
:Datetime Start_Date = Datetime.newInstance(2019, 10, 1, 12, 12, 12);
:Date Final_date = date.newInstance(Start_Date.Year(), Start_Date.month(),Start_Date.day()); <--- You can use this to Typecast datetime to date
In your case just replace variable 'Start_Date' with field 'Last Transfer Date'
Then you can calculate difference between 'Today's date' and 'Final_date'
:integer date_difference = Final_date.daysBetween(date.today());
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Ajay Dubedi
www.ajaydubedi.com