You need to sign in to do that
Don't have an account?

copying value from a text field to a date field
Hi,
I need help on the below requirement as follows,
I have a TEXT field on case object which stores the value in DD:MM:YYYY HH:MM:SS (11/12/2018 11:22:23) format
I have another DATE field which i need to copy the date value alone from the previous text field and store it in date field.
Please let me know how to achieve it
Thanks
I need help on the below requirement as follows,
I have a TEXT field on case object which stores the value in DD:MM:YYYY HH:MM:SS (11/12/2018 11:22:23) format
I have another DATE field which i need to copy the date value alone from the previous text field and store it in date field.
Please let me know how to achieve it
Thanks
I tried the below code
The date is populating but the values are coming but wrong values
for eg:
the original field one had
15/03/2018 13:30:00
the new field value came as
3/03/2019
All Answers
In Apex you could use the following code write trigger:
If you're doing this in a Field Update the following formula should work.
or
Creates a formula field which return type is date and use this formula.
DATE(VALUE(MID(Date__c, 4,4)), VALUE(MID(Date__c,2,2)), VALUE(LEFT(Date__c,2)))
if you found this answer helpful then please mark it as best answer so it can help others.
Thanks
Akshay
DATE(VALUE(MID(Departure_Date_Time__c, 4,4)), VALUE(MID(Departure_Date_Time__c,2,2)), VALUE(LEFT(Departure_Date_Time__c,2)))
but when try to save the record it am getting the below error
Action Field Update Error
A workflow or approval field update caused an error when saving this record. Contact your administrator to resolve it. Updated Departure Date/Time: value not of required type: sfdc.formula.impl.InvalidNumericValueException: The value '03/2' is not a valid number.
15/03/2018 13:30:00
Please help me
Thanks
Akshay
I tried the below code
The date is populating but the values are coming but wrong values
for eg:
the original field one had
15/03/2018 13:30:00
the new field value came as
3/03/2019
the values for day and month was mapped wrongly , i changed its working now , thanks for your help