How to Extend Sales Order Update Functionality to Custom Fields in Dynamics AX

By Jeremy Dobler | April 11, 2016

How to extend sales order update functionality to custom fields in dynamics ax

I worked on a feature to add custom fields in Dynamics AX to the sales order header and lines. With this customization, there was a requirement that if you were to update the custom field on the sales order header, the value would also transfer to all the sales lines. Dynamics AX already does this for some fields out-of-the-box. In this article, I will show you how you can extend this attribute to your custom fields.

Once you have added the fields to the SalesTable and the SalesLine table and exposed the fields on the SalesTable form, add the new custom field to the HeaderToLineUpdate field group on the SalesTable Table.

Project Sales Table Update in Dynamics AX

In order for the system to recolonize the sales order to line fields that need to be updated, the fields must be set to prompt, or always, in the Account Receivable parameters form. (Accounts receivable – Setup – Accounts receivable parameters – Updates – Update order lines (Button))

To add this field to the update order lines form, you will need to modify the lineUpdateDescription method in the SalesTable2LineField class. Add the following code highlighted below, replacing the SSI_TransDate field with your new custom field.

Classes Sales Table in Dynamics AX

Once this is complete if you go back to the AR parameters form, you will now find your custom field listed on the Update order lines form. Note: make sure to mark the field as prompt.

Update order line in Dynamics AX

The sales order line update process uses the sales order document service, so you will need to add some custom code for the system to copy the value from the sales header to the sales lines.

In the AxSalesTable class I added a new method:

Code in Dynamics AX

In the AxSalesLine class I added the following new method:
Code in Dynamics AX

Code in Dynamics AX

The final piece to the puzzle is to add the set*YourCustomField* method to the setTableFields method in the AxSalesLine class:

Set Your Custom Field

Since you’re are modifying a service document, make sure to run an incremental CIL. But, once this is all complete you should find the sales order update functionality working for your custom fields.

Related Posts

Recommended Reading:

Managing Your Business Through Uncertain Times Using Dynamics 365 Finance and Operations

  Dynamics 365 Finance and Operations (F&O) can help you make informed decisions on how to move your business forward. […]

Read the Article
5.13.22 Power Platform

Using Power BI Object Level Security

  The following article will demonstrate how to use Power BI Object Level Security to disable column data based on […]

Read the Article
5.12.22 Dynamics CRM

How to Use the Stoneridge Support Portal

Stoneridge Software’s support portal is an intuitive and useful function that makes it easy for you to access resources to […]

Read the Article
5.6.22 Dynamics GP

Dynamics GP Transaction Removal: Purchase Orders

  Are you having performance issues with Purchase Orders?  Do you find that there are old Purchase Orders on your […]

Read the Article
5.5.22 Dynamics GP

The Real Story about the Long-Term Future of Dynamics GP Support

I’ve seen a number of people put forward comment that Dynamics GP is going away and you have to get […]

Read the Article

New Features in Dynamics 365 Business Central 2022 Wave 1 Release – Financial Enhancements

The Dynamics 365 Businses Central 2022 Wave 1 Release has a lot of new and exciting features to help your […]

Read the Article
4.29.22 Dynamics GP

Dynamics GP Transaction Removals: Bank Reconciliation

  This is part 2 of a 3 part series on Dynamics GP Transaction Removals. These quick tips will hopefully […]

Read the Article
4.28.22 Dynamics GP

Uncommonly Used Features – Integrate Purchasing and Payables to Fixed Assets in Dynamics GP

Being able to integrate Purchasing and Payables to Fixed Assets in Dynamics GP will help you create visibility for your […]

Read the Article

New Features in the Dynamics 365 Business Central 2022 Wave 1 Release – Ease-of-Use Features

  There are many new features in the Dynamics 365 Business Central 2022 Wave 1 Release to get excited about! […]

Read the Article

Start the Conversation

It’s our mission to help clients win. We’d love to talk to you about the right business solutions to help you achieve your goals.

Subscribe To Our Blog

Sign up to get periodic updates on the latest posts.

Thank you for subscribing!

X