You need to sign in to do that
Don't have an account?
Vivekh88
Add minutes to DateTime Fields
Hi everyone,
We have a requirement where we are adding new records to a custom object by a roq dynamically which has a DateTime field and a Duration field.
for example,
We have a datetime field as '21/2/2016 03:45 PM' and Duration as '20' then when he clicks add row the next DateTime field should be updated with '21/2/2016 04:05 PM'
This is my method in Apex class and screenshot of the page
Thanks
Vivekh
We have a requirement where we are adding new records to a custom object by a roq dynamically which has a DateTime field and a Duration field.
for example,
We have a datetime field as '21/2/2016 03:45 PM' and Duration as '20' then when he clicks add row the next DateTime field should be updated with '21/2/2016 04:05 PM'
This is my method in Apex class and screenshot of the page
public void addMoreRows(){ AgendaTopics__c AgendaTopic = [SELECT Id,Topic_Owner__c,Time__c,Event_ID__c,Response__c,Issues__c,Estimated_Duration_minutes__c,Topic_Name__c FROM AgendaTopics__c where Event_ID__c =: everec.id LIMIT 1]; AgendaTopic.Event_ID__c = everec.id; AgendaTopic.Time__c = everec.StartDateTime; if(AgendaTopic.Time__c != null && AgendaTopic.Estimated_Duration_minutes__c != null) { datetime myDateT = AgendaTopic.Time__c; double d = AgendaTopic.Estimated_Duration_minutes__c; Integer shootmins = d.intValue(); AgendaTopic.Time__c = myDateT.addminutes(integer.valueof(shootmins)); } listAgendaTopic.add(AgendaTopic); }
Thanks
Vivekh