Printing a document (check) through the Documents API

Discussions related to custom development with Select.
Post Reply
ckootg
Posts: 122
Joined: Fri Jan 06, 2012 6:10 pm

Printing a document (check) through the Documents API

Post 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);
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

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

Post 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.
Bob Richards, Senior Software Developer, SoftPro
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

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

Post 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.
Bob Richards, Senior Software Developer, SoftPro
Post Reply