web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

How to automate BOM Journal creation and Report as Finished posting from a staging table?

(0) ShareShare
ReportReport
Posted on by 15

Hi everyone,

I am working on a customization in Microsoft Dynamics 365 Finance & Operations where I need to automatically create and post an Inventory Bill of Material (BOM) Journal based on records coming from a custom staging table.

I would appreciate guidance on the recommended X++ approach, especially for automatically triggering Report as finished and posting the journal.

1. Overall requirement

The process should work as follows:

TPGNM_StockTakeAdj (staging table) → Determine Journal Type → Create BOM Journal → Trigger Report as Finished → Populate RAF details → Post


2. Staging table – TPGNM_StockTakeAdj

The source data comes from the custom table:

TPGNM_StockTakeAdj

The fields required for journal creation are already available in this table and are similar to the fields currently being used for creating a Movement Journal.

The staging table contains the item/product variant, warehouse, quantity, reason code, etc.

The requirement is to use these records as the input for creating the BOM Journal.


3. Create the BOM Journal

This has been done through coding.


4. Trigger "Report as finished"

After the BOM journal is created, the next requirement is to automatically trigger:

Functions → Report as finished

This is the main area where I need guidance.

When manually using Report as finished, D365FO opens the Report as finished form.

The form is populated based on the selected product/item variant.

The required values are:

  • Product number / Item → From the staging record

  • Site → Default from the journal header

  • Quantity → From the staging table

  • BOM → Should automatically come from the active BOM

  • Explosion → Always enabled

  • Post now → Yes

After these values are populated, the requirement is to programmatically perform the equivalent of pressing the OK button.

This should automatically post the journal.

 


5. Expected automated process

The final automated process should therefore be:

TPGNM_StockTakeAdj

        |

        v

Create BOM Journal Header

        |     |

        v

Create/Populate BOM Journal transaction

        |

        v

Trigger Report as Finished

        |

        v

Equivalent of clicking OK

        |

        v

BOM Journal posted


6. What I have already tried

I have tried BOMParmReportFinish.insert() method, but it is not populating in form level, but I am able to see data in SSMS.

I have already investigated the existing D365FO functionality and custom code around the BOM Journal process.

I also checked the standard BOM/Report as finished functionality and the related parameter/transaction tables.

I found that the Report as finished process involves BOMParmReportFinish

I am currently trying to determine the correct standard classes/methods to invoke rather than duplicating the standard Report as finished logic.

I also investigated InventDimId because the Report as finished parameters require inventory dimensions such as Site/Warehouse to be correctly initialized.


7. My main technical questions


Question 1 – Triggering Report as Finished

After creating the BOM Journal, what is the recommended way to programmatically trigger the equivalent of:

Functions → Report as finished

?

I would like to reuse the standard D365FO business logic instead of duplicating the logic from the form.


Question 2 – Automatically clicking OK / Post now

In the UI, the user selects:

  • Explosion = Yes

  • Post now = Yes

and presses OK.

What is the correct X++ method/class that represents this final processing step?

  1. Class name: BOMReportFinish.  closeOk()

  2. Class name: BoMmultiReportFinish.checkCloseDialog()

I want the batch/custom process to perform the same business logic as the user pressing OK, rather than simply inserting records directly into the database.


8. Important requirement

I am looking for a solution that uses the standard D365FO framework/business logic as much as possible and all these should be achieved in single batch job process. 

The desired implementation is:

Custom staging table → standard D365FO BOM Journal/Report as finished framework → standard posting

rather than:

Custom staging table → direct database manipulation 

Thanks in advance.

Categories:

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 378 Most Valuable Professional

#2
CU10121822-0 Profile Picture

CU10121822-0 350

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 345 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans