1
0
-1

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,
	null,
	startDate,
	endDate,
	null,
	null,
	null,
	null,
	null,
	0,
	100);

 

The form definitely executes the service and without error but something is keeping it from returning data. 

Any ideas why the difference?

    CommentAdd your comment...

    3 answers

    1.  
      1
      0
      -1

      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.

        CommentAdd your comment...
      1.  
        1
        0
        -1

        Hi Brad, 

        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!

         

        Petros

        1. Brad White

          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. 

        CommentAdd your comment...
      2.  
        1
        0
        -1

        Hi Brad,

        What happens if you install the script globally instead of the org?

        Bill

          CommentAdd your comment...