I have a service that creates an HTML report based on SubmissionDao.getSubmissionList() and the only input parameters are startDate and endDate.
The service executes perfectly from a Unit test but returns 0 results when executed from a Maestro form. Both the form and the service are in the same org. I am printing out the input parameters and they are identical between the UnitTest and the form inputs.
SubmissionDao submissionDao = DaoFactory.getSubmissionDao();
List results = submissionDao.getSubmissionList(null,
The form definitely executes the service and without error but something is keeping it from returning data.
Any ideas why the difference?
The reason no results are being returned is probably because there is no user security context available for the Submission DAO to determine whether the executing user is authorized to access these records.
Do you not need to specify fields like form code and client id? I'm not sure but they may be mandatory fields. Also I would probably tackle this by trying to return a single submission with it's given tracking code and then inspect it to ensure all it's fields adhere to the criteria you are passing in the get list request
def submission = submissionDao.getSubmissionByTrackingNumber(trackingCode)
Hope this helps!
I tried "submissionDao.getSubmissionByTrackingNumber(trackingCode)" and it works from the form and the unit test.
About your point on the possible missing parameters, the code in the snippet I provided works perfectly in a unit test so I'm not sure formCode and clientId would work. I will try though.
What happens if you install the script globally instead of the org?