Hello, I am trying to create a batch job to auto-post purchase invoice journal entries. The problem I have is that the business profile I am implementing this feature for has hundreds of companies, so it would be infeasible to manually go into each company's profile and re-create the same batch job.
I saw another post where someone mentioned the existence of a cross-company keyword that I can use for the batch job, but I cannot find where this is - - can someone show me where this is?
Hi tl2022,
What is the definition of "plugin" here?
I had another look at the batch options. You can manually add tasks to batch jobs. You can setup one or more batch jobs manually have a different line per legal entity using the class "LedgerJournalMutiPost. Per line, you can set the Parameters to post the journal with the correct journal per legal entity. This will be a cumbersome task like creating the batch jobs separately per company. However, if the customer has a code freeze, you can explain that a customization could save time now and in the future.
Hi, No plug-ins required, as Andre mentioned, you can create new class within D365fo (using visual studio).
Hi Andre, I will read the documentation on classes. Do I have to install it as a plugin into D365? Asking because our client currently has a code freeze and I believe that I would have to get special approval to install any plugins.
Hi tl2022,
You can create a new class for a new batch job which would change the company and per company then calls the same logic as the standard batch does which you are referring to.
Thanks everyone for their input. Can any of these solutions be used for the version of Finance and Operations I am using:
Installed product version : 10.0.31 (10.0.1406.119)
Installed platform version : Update55 (7.0.6651.110)
In this version of the application, I did not write any code to create the batch job. I just more or less followed the instructions as seen in this post - community.dynamics.com/.../auto-post-journals - where I use the "General ledger > Journal entries > Post journals" utility. I don't know where I can add the customization to go across companies if I create the batch job using this method. Can anyone advise?
Hi tl2022,
In addition to the replies above you can consider having a batch job which will create additional batch tasks to divide the workload is you would see some performance issues. Similar to this is the standard workflow processing batch job which creates a task per bundle of 100 workflow messages.
I would just create a small customisation (new batch job) that calls the existing job for all legal entities.
while select id from dataArea where !dataArea.isVirtual { changeCompany(dataArea.id) { //call logic per legal entity here... } }
In fact, I would make it configurable so that it can be reused for other batch jobs as well and not only the one. This should be standard functionality in my view.
Hi, You must have written logic in code to find and post purchase order journal entries. As mentioned in the thread you shared, you can use cross company to get data from all companies and post it. The usage of cross company depends on how you have written the logic.
www.tech.alirazazaidi.com/.../
If still doubt then please provide information like which class you are using and the code in it which will run the logic for batch job.
André Arnaud de Cal...
292,160
Super User 2025 Season 1
Martin Dráb
230,962
Most Valuable Professional
nmaenpaa
101,156