Processing Rules in Configuration Package
Processing Rules in Configuration Package

Configuration Table Processing Rules let a configuration package do more than insert data. After the package creates the records, it can also process them, for example by posting, invoicing, shipping or receiving them. In this post, we will invoice a sales order through a configuration package and also see which actions are available.

Preparing for Processing Rules

  • The package SALES ORDER contains table 36 – “Sales Header” and table 37 – “Sales Line”. Sales Line uses Parent Table ID 36, so the package always processes the header before its lines.
Configuration package SALES ORDER with Sales Header and Sales Line tables
  • First, select the Sales Header table, go to Table and click Processing Rules.
Processing Rules option on the Tables page of the configuration package
Processing Rules page for the Sales Header table
  • A rule has four parts:
    • Table: The table it belongs to.
    • Action
    • Filter: It limits which records the rule applies to.
    • Custom Processing Codeunit ID

The Action field offers Five Values: Custom, Post, Invoice, Ship and Receive.

Action field values in Processing Rules
  • Not every action is valid for every table. Business Central validates the choice. For example, if you select Post on the Sales Header table, you get this error:
Error when Post action is selected for Sales Header in Processing Rules
  • The valid actions as per my testing and reference are:
    • Post: Tables 81 (Gen. Journal Line), 232 (Gen. Journal Line related) and 27 (Item journal related). However, Sales Header does not allow it.
    • Invoice: Sales Header (36) and Purchase Header (38).
    • Ship: Sales Header (36) and Transfer Header (5740).
    • Receive: Purchase Header (38) and Transfer Header (5740).
    • Custom: Any table, together with a Custom Processing Codeunit ID that contains your own code.

I selected Invoice for this test and kept the filter Document Type=Order, so the package processes only orders.

Processing Rules with Invoice action and Document Type=Order filter

Prepare the Data in Excel for Processing Rules

  • I added one order and one quote. The quote is there because it proves that the filter works.

Sales Header Sheet

Sales Header sheet in Excel for the configuration package

Sales Line Sheet

Sales Line sheet in Excel for the configuration package

Import Data into the Package

  • Click Import from Excel and then Import.
Import from Excel option in the configuration package
Excel data imported into the configuration package

Apply the Package with Processing Rules

  • Then click Apply Package and confirm. The Processing Rules run, and the result shows that the package processed 2 tables, inserted 4 records and found 0 errors.
Apply Package result showing Processing Rules ran without errors
  • The Sales Header count moved from 89 to 90. The package inserted two headers, then invoiced and removed the order, which leaves only the quote as a new record.

Check the Processing Rules Result

  • Open the Customers list and select customer 10000. Posted Sales Invoices increased from 69 to 70 and Ongoing Sales Quotes increased from 2 to 3. As a result, we can see that the Processing Rules invoiced the order and left the quote untouched.
Customer 10000 Posted Sales Invoices after applying the package
  • As a result, the new posted invoice is 103316.
New posted sales invoice created by Processing Rules
  • Open the invoice. As expected, the Order No. is CFGINV01 and Your Reference is INVOICE TEST, which matches the data from the package.
Posted sales invoice created through the configuration package
Posted sales invoice lines created by Processing Rules
Posted sales invoice details in Business Central

On the same side, the Sales Quote is also created.

Sales Quote created by the configuration package
Sales Quote not processed because of the Processing Rules filter
Sales Quote remains unposted after applying the package

Conclusion

  • Processing rules turn a configuration package into a small automation tool.
  • Therefore, always use a filter so that the package processes only the intended records.
  • For logic that Post, Invoice, Ship or Receive do not cover, use Custom with your own codeunit.

Also, read more Business Central guides on Ahmad365 Blogs.

Hope so this is Helpful 😃

By Ahmad Subhani

Microsoft Dynamics 365 and Business Central consultant sharing practical insights, new features, product reviews, and real-world solutions for modern businesses.

Leave a Reply

Your email address will not be published. Required fields are marked *