Application Studio, change report style for new layer, print quote form

I have a custom layer in application studio for the quote form. When I go to print the Quote Form, I want to change the company default report style automatically for this customized layer to a report style that matches the customized form. See the screen shot.

Does anyone know how to do this?

Please help!

Thank you,
Richard

On the print slide out overflow menu there is “Save Defaults”. I have had issues with this though, it will carry thru to other reports depending on what you set a a default.

1 Like

Set the company default in the company list for the report style in Report Style. This has made it default the drop down to the one selected.

I do not think you need to do anything in Application Studio unless you want to change it based on other parameters. If you do want to change it in that case for a specific user or something, I would do a row-update event after the form loads with some conditions.

1 Like

It is doable via App Studio… but it takes some doing…

You’ll need to customize both Quote Entry AND the QuotForm (process) in App Studio as we need to set up events to both SEND and RECEIVING the desired report style.

Quote Entry > SENDING VALUES
QuotForm > RECEIVING VALUES

~*~

Let’s set up the “Receiving” side first:

Open App Studio and filter for QuotForm. This is the form that opens when you click the print button.

Open the base layer, and then create a new layer for us to play with. Remember the name of this new custom layer. You’ll need it later!

We need to override an existing base event. “setFormOptions”. This is the event that is setting the initial values on the Print Quote Form when it opens.

Search for it, right-click and “Copy”

image

Rename your copy if you want… and repoint the trigger to override the original base event.

In the row-update, you’ll see this column being updated:
image

image

This is the QuoteNum coming in from Quote Entry when you click the print button. We still want this. What we want to do is set up a second receiving column so we can receive the incoming desired StyleNum.

So, we need to add a second column here… but first, I’ll show where we get the binding…

If you look at the Print Quote Form page, you’ll find the Report Style is bound as follows:

This is the binding we want to update on form load.

So, back in the event > row-update… we want to add a column:

Below is what you’ll want to add to the row-update (column 2):
image

image
"%session.context.initialValueIn.styleNum%"

With that set. Save this layer and publish it. Again, remember the name of this layer!

~*~

Go back to your Quote Entry custom layer and we’ll now work on the SENDING side of the process:

Here, we also need to create an event… but you need to decide what you want to do. You can either hijack the existing print icon… OR, set up your own button. In this example, I set up my own so I could easily test one vs the other.

So, figure out what you want to do here… use the existing icon, or create your own button.

Next we need to, again, copy the base event that is being used when you click the print icon.

image

Once copied, again, rename the event if you want.

Then re-point the trigger. If you want to hijack to existing icon, you can set this event to Override the base OnClick_toolQuoteHedPrintForm event.

If you set up your own button, your trigger will be Control > On Click > Name of button… like my example below:

image

Now we need to modify the app-open event widget… Click on that and open the Parameters:

We still want the button to open Erp.UIRpt.QuotForm… but we want the custom layer we built earlier to also be applied (so that our “Receiving” event will be applied)… so enter the name of your custom layer here:

Next, scroll down to the “Launch Options” and open the json editor. Add a comma, and then the last line I underlined below:

image

So, now this event, when it launches will pass the QuotNum, but will now also pass a hardcoded “styleNum” as well.

If you don’t know your StyleNum, you can find it in Report Style Maintenance:
image

My company’s DEFAULT is style 1001. So, for this exercise, I’m hardcoding stye 1002.

Unless I’m forgetting something, that’s should be it.

Save & Test/Preview:

I now have two buttons:

If I click the print icon… I still get my default report style (1001):

If I click my new button… I now get the 1002 style:

4 Likes