I have just started learning APEX but have old C , basic experience.
I am trying to use a date field and time field for my object to allow smoother input of scheduling appointments. I have converted the date to startdate string and time is already a string - I can combine both and was using Valueof method to create the datetime field but the format is invalid as datetime wants yyyy-mm-dd hh:mm:ss and my string is coming out mm/dd/yyyy hh:mm AM or PM.
I guess i can break everything down to day, month, year and then reconstruct but hoped there was a less cumbersome way. Want the date / time input to input the way the default event page does it.
Any help for this APEX novice is appreciated
I have created a custom object called PTO. I have also created an approval process for it. How can I create a trigger so that it automically executed the approval process i have setup as soon as a new PTO record is created(inserted). This would behave the same way as if I manually pressed the submit approval button.
trigger PTO_Trigger on PTO__c (after insert)
for(PTO__c pto: [select id from pto__c])
Approval.ProcessSubmitRequest req1 = new Approval.ProcessSubmitRequest();