Friday, February 22, 2013

How to get the leave start and end dates from the xml


If you ever have to get the leave start and end dates from the xml of a business object here is one way to do it. This assumes you’re working in an alert or scheduled task.
  
//Start_Date20130225 000000
//End_Date20130228 000000

BOFormInstance bo = new BOFormInstance();

bo.setXML(busObjXml);

String startDate = WorkflowUtil.getFieldValueAsString(bo, "Start_Date");
String endDate = WorkflowUtil.getFieldValueAsString(bo, "End_Date");

There You have it.

Thanks Dave!