You need to sign in to do that
Don't have an account?
Esther Thomas 2
adding hours to datetime not updating
Hi All,
I want to add hours to a custom field and save the record. I'm able to save but when I look at the value for my custom field,
End_Date_Time__c it's the exact same as my Start_Date_Time__c. I'm not sure what I'm missing here. Thanks in advance for any help.
I want to add hours to a custom field and save the record. I'm able to save but when I look at the value for my custom field,
End_Date_Time__c it's the exact same as my Start_Date_Time__c. I'm not sure what I'm missing here. Thanks in advance for any help.
public PageReference save(){ try{ //calculate end date/time hours=2; Records.End_Date_Time__c = (Records.Start_Date_Time__c + (hours/24)); //assign client to new booking?????? Records.Client__c = SelectedClient; //assign Availability/sitter????????? Records.Availability__c = SelectedSitter; insert Records; }catch(Exception e){ } return null; }
try below code :
i hope it helps you.
Let me inform if it helps you and kindly mark it best answer if it helps you so it make proper solution for others
thanks
sfdcmonkey.com