Intercepting/Preventing the popups on Document Distributions

Discussions related to custom development with Select.
Post Reply
jwautier
Posts: 4
Joined: Wed Sep 29, 2021 5:45 pm

Intercepting/Preventing the popups on Document Distributions

Post by jwautier »

How do I either:
  • Prevent the SoftPro controlled Email/Publish/Save to File modal boxes from showing?
  • Or how can I make the system run the Email print spooler last?
  • Or how could I have SoftPro disable the other 3 distribution options when Email is selected?


1.png
1.png (6.01 KiB) Viewed 1265 times
I wrote a print job handler to replace the default email handler, following all of the examples and SDK documentation... but everything I have runs "After" SoftPro asks the user for input like the printer, the contacts, the attachment folder, or the file path. That is my problem.

More background to explain... I've registered all 3 print job stages and check the metadata to determine if someone is selecting "Email" to override and "do my own thing". So in the shell class header:

Code: Select all

//Print Job
    [ProvidePrintJobHandler("Q4 Print Job Pre Process Handler", typeof(KBTShell.CustomClasses.Q4PrintJobPreProcess), PrintJobStage.Preprocessing, 10)]
    [ProvidePrintJobHandler("Q4 Print Job Handler", typeof(KBTShell.CustomClasses.Q4PrintJobProcess), PrintJobStage.Processing, 10)]
    [ProvidePrintJobHandler("Q4 Print Job Post Handler", typeof(KBTShell.CustomClasses.Q4PrintJobPostProcess), PrintJobStage.Postprocessing, 10)]
And the initialization:

Code: Select all

//Print job override
base.RegisterPrintJobHandler(new KBTShell.CustomClasses.Q4PrintJobPreProcess());
base.RegisterPrintJobHandler(new KBTShell.CustomClasses.Q4PrintJobProcess());
base.RegisterPrintJobHandler(new KBTShell.CustomClasses.Q4PrintJobPostProcess());
and I only do "my stuff" if they selected Email:
4.png
4.png (29.08 KiB) Viewed 1265 times
My override of the email print job has its own dialog, which I show modally through a timer after the the print job overrides run. This works great and allows me a to develop a highly complex delivery system to meet all of our needs. I do it by simply initializing and passing in the printjob into the main shell reference, then enabling a variable which is on a timer to determine if it should show the form in the main shell class. So I run this on the post process override function. Again... works great!

Code: Select all

// Offload the values to an internal variable and set a timer on the main
// shell class to run this AFTER the print job handler finishes so the dialog does not end up
// showing "behind" the main SoftPro window.
KBTShell.KBT.Q4DeliverySystemDialog = KBTShell.Helpers.PrinterHelpers.GetEmailDialog(printJob, ss);
KBTShell.KBT.SOFTPRO_SHOW_EMAIL_DELIVERY = true;

// Stop the email print job since everything else will be handled by the custom delivery system 
// that will open in 1 second.
return PrintJobHandlerResult.Stop;
Initially, I had tried to show a modal dialog right here in the postprocess routine to halt distribution, but we had too many erratic z-index issues where my modal dialog would "get behind" the main SoftPro window and effectively lock the user up. That's why I moved over to a timer based solution.

However, I am now finding that our users want to distribute to more than just email. They often click email and "Publish". Now, I can do both in one shot in my delivery system... but we now have the same z-index problem because both "Publish" and "Save as File" have system generated modal boxes (Email does too, but I use it to allow the user to select the recipients, so it's ok if that stays).

The print spooler does each of these 4 jobs independently and sequentially (with Email being second, always), so I now have the problem of having dual modal boxes open and the interface locking because my dialog opens after the Email spooler, executed on a timer, but the print subsystem still has to go through the whole process for "Publish." That means this box is shown modally, behind my dialog, which is also shown modally, causing the interface to become unresponsive.

So that is what shows up that gets "hidden" behind my interface, which is also modal "first" but technically shows up in the front.

If I check both "Email" and "Publish", I get the system email box (I'd rather not get it, but I can work with it or just tell people to click on through). Then they select a few email addresses and click OK here. Because I have no known way of preventing the "Publish" or "Save to File" pop ups if those options are also checked, we get locked up due to the z-index issue from conflicting modals.

The only thing close to a solution I've found is to set my dialog to be TopMost = false, but then an subsequent SoftPro input popups for "Publish" or "Save to File" will sit "on top" of the email system interface. This results in a "usable" but very confusing screen for the user.
9.png
9.png (82.66 KiB) Viewed 1265 times
That's at least usable, but it is going to confuse the heck out of the hundreds of people that use this unless we train them to never do more than one of the 4 options... also a solution, but I'd rather prevent the problem from happening and not rely on the users to remember one additional thing in their already extensive training.

Maybe I'm just looking for the wrong things... but in v 4.3, I don't see anything in the SDK that gets me any sort of hook, override, or control from any part of the Document Distribution screen. We are planning on working with SoftPro soon to get to a newer version of Select in case the answer to my problem lies there.

Thanks in advance. -Jason
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Intercepting/Preventing the popups on Document Distributions

Post by BobRichards »

This issue has been passed to R&D for review. I'll let you know any findings when I get them.
Bob Richards, Senior Software Developer, SoftPro
jwautier
Posts: 4
Joined: Wed Sep 29, 2021 5:45 pm

Re: Intercepting/Preventing the popups on Document Distributions

Post by jwautier »

Thanks Bob. I'm happy to provide any other information needed.
jwautier
Posts: 4
Joined: Wed Sep 29, 2021 5:45 pm

Re: Intercepting/Preventing the popups on Document Distributions

Post by jwautier »

Any updates from R&D?
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Intercepting/Preventing the popups on Document Distributions

Post by BobRichards »

No, sorry.
Bob Richards, Senior Software Developer, SoftPro
Post Reply