How do you print from Method Directive?

Hi everyone

I have a Method Directive set up that sends an email containing a list of parts each time a new sales order is created based on a couple of conditions.

The BPM works fine.

There’s a new request now to not only send the email but to also print the contents of the email to a network printer. We already have the printer set up and we have another BPM that prints to it so that’s all set up and working.

My question is: there is no Auto-Print widget in Method Directives and even if there was one, I don’t think I’d be able to use it to print the contents of the email. The contents of the email contains variables and a tableset variable (the list of parts).

So how can I achieve this? Is there a way to use custom code perhaps?

Thanks!

1 Like

…that popcorn tag is not a good sign! lol

2 Likes

The first thing you will probably want to do is create a report, like a baq report.

Then you will have to tell the system to print it.

Several examples on the forum I believe.

Use the out of the box Method Master report. Then do what @klincecum said. If you need any more help, let us know.

1 Like

Thanks guys. I was hoping not to have to go the route of creating a BAQ report!

Once I’ve created the BAQ report, is there a way of printing it from a Method Directive or do I have to convert everything to a Data Directive?

Thanks

Yep. Get your ducks in a row and come back.

Printing instead of previewing requires a tad more setup, but not much.

We’ll point you at some relevant code.

You don’t have to. Use the Methods Master report.

image

1 Like

Thanks. I’ve created a BAQ Report. What’s the next step to get it to print from a Method Directive? Thanks

Hi Kevin

I’ve created the BAQ Report. Please let me know if you know how to print it from a Method Directive.

Thanks

I’d be more inclined executing a report from a Function then calling that function from the method directive. Should be plenty of posts here about that topic.

EDIT - (due to the fact I don’t make any sense speaking in my antipodean tongue) :slight_smile:
Passing in all the required parameters to the function from the call in the BPM.

Parameters = Function Signature

1 Like

That’s how I’ll show him.

We’ll need a trace of you printing it to the printer you want it to print to, unless you just want it to pop up as a preview. A preview is my preference, and is super simple.

1 Like

Why? Just want to make sure I understand best practices

Let me translate the Aussie.

He wants to call the function from the method directive. The directive will just contain trigger logic code.

Keeps everything nice and tidy and easier to manage and reuse.

3 Likes

While @klincecum continues to help you I’d like to go back and ask the question that we always ask for requests like this.

What business problem are you trying to solve? Mostly to understand if there are better options for you and so that others in the future can understand what the need was and if it helps them :slight_smile:

4 Likes

We run the best, most helpful, and thoughtful help desk on the planet. :delicious:

6 Likes

Most days :grin:

2 Likes

If we do say so ourselves…

3 Likes

I’d say so.

2 Likes

The function stuff I recently covered here:

If that is too messy, let me know. (it was part of a larger conversation)

As far as the method directive, you would just write a little glue code to call the function you made.

Something like

if(sometrigger)
{
    InvokeFunction(Library, Function, ReportName, ReportStyle, "SSRSPREVIEW"); // etc
}

If you need a complete example, I could probably be convinced to work one up, but you must be amusing.