Page 1 of 1

Printing a document (check) through the Documents API

Posted: Tue Jul 05, 2022 9:53 pm
by ckootg
We've been printing checks via the Documents API, which has worked, but have now run into a peculiar issue.

The check template crystal report has been changed to display a "Approver and disburser cannot be the same person" message.

I have the crystal report and when I preview the report in Crystal Reports, the check displays correctly using the values I pass in through the Documents API. However, when I use the Documents API, I get the "Approver and disburser cannot be the same person" message. The Approver is blank, so is ProTrust passing in a blank USERID to the check template?

This is how I print a check using the Documents API:

Code: Select all

string docName = "DOC_check_template";
IDocumentInfo docInfo = documentManager.Documents.Where(t => t.Identifier.Name == docName).FirstOrDefault();

ITransaction transaction = transactionsManager.GetTransaction(transactionInfo);
IRendererFactory rendererFactory = selectServer.GetService<IRendererFactory>();
IRenderer renderer = rendererFactory.Create();
IRendering rendering = renderer.Render(docInfo, transaction, null);

Re: Printing a document (check) through the Documents API

Posted: Wed Jul 06, 2022 5:33 pm
by BobRichards
Sorry but I don't have the answer. I have to send this to R&D for resolution. I will furnish any updates they provide.

Re: Printing a document (check) through the Documents API

Posted: Tue Jul 26, 2022 3:22 pm
by BobRichards
From R&D...
Crystal Reports does not check if the user is the one who approved the disbursement, however, Select will do this check. The API should be following the same logic as Select and would therefore perform the same user validation. Crystal Reports will allow you to validate a check with any user (even a blank one), but you cannot do that in Select (or the API).

There is a profile setting that can be changed to alter this behavior in Select. It can be found under: SPAdmin -> Configuration -> Profiles -> Accounting -> "Approve pending disbursements". You can uncheck the "Approval required" checkbox and it should work.

Alternatively, you can try to pass in a valid user via the API and if it is different from the user that approved the disbursement, it should work correctly as the criteria would then be met.