Hi there - I’m trying to create a Trading Networks “document transfer report” using public TN services. However, services like wm.tn.query:createDocumentQuery only allow me to select from a list of pre-selected date ranges. For eg: “YESTERDAY”, “TODAY”, “LAST_WEEK”, etc.
Is there any way to create a document query that takes an arbitrary date range?
I’ve had some success with the code below. It takes 3 params - a query (object), FromDate and ToDate (both strings) as input. It then maniputes the query object so the query date period is set to these dates. The modified query object is returned as output.
Note: the code is pretty skeletal (no error handling).
SimpleDateFormat simpledateformat = new SimpleDateFormat(“yyyy-MM-dd HH:mm:ss”);
Date date = simpledateformat.parse(FromDate);
Date date1 = simpledateformat.parse(ToDate);
if(date1.after(date))
sdq.setTimeInterval(new Timestamp(date.getTime()), new Timestamp(date1.getTime()));