Hello,
We want to select more than one template for SalesConfirm.Report template that we use as Dynamics 365 F&O Docentric template. However, if you want to print this report in any of the Print/Preview>Copy-Original options on the Sales and Marketing>Sales Orders>Order Confirmation>Sales Order Confirmation (FormRef: CustConfirmJournal) screen, it always prints the default template. I have activated the parmShowDialog method in the SalesConfirmController class to print the template of my choice on this screen. However, it still prints the default template, not the template I have selected. How can we solve this problem, is there a method to print the template I have selected.
Hi, and welcome to Docentric Forum!
When you want to print different Docentric templates from the Sales order confirmation journal, you first need to set up Print management settings for the report, where you can use conditional print management settings to select different templates under different scenarios. When you set that, you can then print the report using either Preview/Print > Print management preview or Preview/Print > Use print management. Either of these menu choices will apply print management settings.
You can also use Docentric AX reports form to set rules for template selection, if you want to use different template for different company or language combinations. In this case make sure, that you use the same Template ID and that you have one entry with empty Company and Language fields, which will act as fall-back in case if no other combination will be matched. Make sure you click Set default so that all the entries with the same Template ID will be marked as default. In print management select @DOCENTRIC_DEFAULT_TEMPLATE@ which will use the default templates and select correct one, based on the company and language of the report at runtime.
We have two different templates. We always use the SalesConfirm.Report default one. In some orders we also want to print this DOP template, our data is the same. Unfortunately, the Use Print management or Print Management preview options you mentioned do not open at all. I intervened in the code to open the Print management dialogue, otherwise it prints @default_template directly to the screen.
I appreciate your interest.
Hi @volkanas,
I’m not sure where the issue is, so let me explain how things should work with the standard and how with Docentric.
By standard the system prints the default template for the Original/Copy option. This is how it works normally and can only be changed through code.
In addition to this, Docentric introduced company-specific templates to replace the default template based on the company.
We also added a “Print management preview” to show a preview of the report based on your print management setup.
From what I understand, you modified the code to use a different default template for the Original/Copy option, and it’s not working correctly now. Is that correct?
In each of these cases the dialogue window never opened. When I first asked you a question in the topic, I opened the dialog window in DEV environment for testing (with parmShowDialog) but it didn’t work and I reverted the development. I tried there to open the dialog window and select the template I want from there before printing, but it prints @default_template in every case.
Now I am trying it in TEST environment and this screen is standard. We want to be able to select from more than one template. But copy and original directly prints the default template to the screen. I have now made a definition in ‘Print management setup’. Now when I click on Print management preview, it prints both templates on the screen. This may be partially useful for now.
However, what I want to understand is, why when I manage to open the dialogue window in DEV, it prints the @default_template and not the template I selected. Is there a setting for this in printjobsettings? I’m a stranger with the docentric library, how can I find it in the code?
Hi @volkanas,
If you want to achieve ad-hoc template selection it is a bit trickier. You can open the print destinations settings dialog with code, but these settings are overridden in FormLetterReport.loadPrintSettings(), so you should extend this method as well and take care of the settings. We plan to add this feature in the mid future.
If you know in advance which customer/orders needs which template you can set it in print management. Note that it supports also conditional settings and overrides on customer and order level.
For example: It you override Print management setting for specific sales order (All sales orders > General\Print management), select the template there and print order confirmation with Use print management (or Print management preview) it will be printed with selected template.