In part 1 of this series of blogs we learned what exactly are configurable business documents and what is the required setup. In part 2 we saw where to start and we created a derived version of a format configuration. In this last part we will customize our derived format configuration, derive related configurations and run the result.
Customize the Format configuration
As the format configuration tree structure at this moment still displays the out-of-the-box Excel template layout structure, you should now start modifying the Excel document downloaded earlier. The first thing to do is enabling the checkboxes on the View tab:
Then you are ready to create a fancy layout which meets the customer’s needs. You should know that the names of the cells and ranges in the template are used in the format configuration to bind the data from the model data sources to it. Therefore when you move a field to another position, make sure you cut and paste it so the name of the field is moved together with the other information. Also, when creating a new field make sure to define a suitable name for it. The Name Manager will become your best friend to manage all names and references:
Note that the names of all fields within a range should be prefixed with the name of this range. So if you move a field to another section, the field should be renamed. Otherwise this will result in validation errors in the business document format configuration.
Once you have finished your initial version of the template, you attach it to the business document format configuration. You could use the import functionality from within the format designer via Import > Update from Excel. However, I do not recommend doing this because you are at great risk of losing all your existing mappings. A safer way to link your new template is to go to the Attachments, create a new attachment record and link your template. Then delete the old attachment record, open the Designer and select the newly attached attachment in the Template field.
After this you can start mapping the new format data to the data model in the Designer. When you think you are done, press the Validate button. If there is something wrong in the format mapping or the format is not in line with the Excel template, you will get a list of errors you will need to solve. Sometimes a Fix button is there by which you can automatically fix one or more of the errors. Note that this will not always give the desired result, so be careful with using that button!
Model and model mapping configurations
It might be that the result of the existing data model binding is not completely what you want to be displayed on your business document. To solve this you can adjust the model mapping configuration. You do this by selecting the out-of-the-box model mapping configuration and then Create configuration from the menu. Again we select Derive from to create our own draft version of the model mapping configuration which we then can adjust to meet our requirements. Sometimes we have added a new field to our format configuration which cannot be mapped to any element in the existing data model. In that case you can create a derived configuration of the data model, add the missing element and after that map it to the right data source in your custom model mapping configuration. And at last in your custom format configuration the new data field can be bound to the new element you have just added in your model mapping.
Note that the changes in the data model and mapping might not be immediately visible in the format configuration. Then you should first set the Status of the model and/or mapping to Completed. There is however a workaround, so you do not have to set the status to Completed or Shared after each change you do. Via Configuration > Advanced settings > User parameters…
you can set the Run settings radio button to Yes:
This results in a Run Draft option on your configurations which you can set to Yes. This is very handy during the development and testing of your configurations.
Testing the end result
Now we have done our customizations we are of course very curious what the business document will look like at running it. To test the format there is a Run option on the format configuration. However, this will almost always result in runtime errors because of missing input data. So the best way to test your business document is doing this by using the functionality in the application itself, by generating a pro forma version or viewing it from an existing journal. Make sure that you first link your new business document to the print management Report format field via [module] > Setup > Forms > Form setup > Print management > [business document].
And because you do not want to send your business document as an Excel document which can be edited, you should also setup an electronic reporting destination which includes PDF conversion. Note that besides in the ER workspace, the menu option for this is also available in the Organization administration > Electronic reporting submenu next to a lot of other ER menu options.
In the Electronic reporting destinations form you create a new record, give it a recognizable name and create a new File destination record for it in which you check the Convert to PDF checkbox:
Via the Settings button the required Destination settings can be specified:
This brings us to the end of this series of blogs. You will have noticed that I did not discuss Word as format configuration template, although for some of the business document format configurations besides Excel also Word template versions are available. I guess this is my personal taste because the layouts of Excel are completely WYSIWYG where the layouts of Word are not (at least for me). If Word has no secrets for you and you know your way around while creating templates using content controls and things like that, feel free to eat your heart out.
Anyway, as they say: “The proof of the pudding is in the eating”. So I would suggest you dive into the exciting world of Electronic Reporting yourself. There is a lot to learn… have fun!
Please read the other related articles on this link https://kaya-consulting.com/category/Business-Documents/