You need to sign in to do that
Don't have an account?
Cris9931
But this is not working, I tried to change the timezone from my user and everytime I change and System.Debug I see different DateTime because of the timezone conversion...how can I avoid this?
display the maximum and minimum datetime from a text field
Hi, I have a master-detail relationship between two custom objects. Work Order(master) - Work Detail(detail).
On Work Detail I have 2 fields which displays Date/Time but in a text field format. Like this:
How to make a trigger without time conversion to display the maximum and minimum dateTime from the child(work detail)?
I started writing the trigger:
List<Id> listWoId = new List<Id>(); for(SVMXC__Service_Order__c loopwo : Trigger.new){ listWoId.add(loopwo.Id); } List<SVMXC__Service_Order_Line__c> currentWL = [SELECT ID, Name, SIG_Start_Date_Time_Device__c , SIG_End_Date_Time_Device__c from SVMXC__Service_Order_Line__c where SVMXC__Service_Order__c =: listWoId]; for(SVMXC__Service_Order_Line__c workDetail : currentWL ){ DateTime dt = DateTime.valueOf(workDetail.SIG_Start_Date_Time_Device__c); System.debug('dt' + dt); }
But this is not working, I tried to change the timezone from my user and everytime I change and System.Debug I see different DateTime because of the timezone conversion...how can I avoid this?
let me know if it helps