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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Issues with adding InventDim datasource to a form extension

(0) ShareShare
ReportReport
Posted on by 692

Hi

I have to add the field InventDimId to the serial number table (InventSerial) and also add the InventDim table as a datasource to the InventSerial form using extensions. I have found a blog post (ievgensaxblog.wordpress.com/.../ax-7-extending-forms-using-form-parts) about using a form part to connect from the InventSerial datasource to the data in the new form so that I can avoid the super() call on the create method of the InventDim datasource.

The issue I am having is that when I press the edit button to edit InventSerial record none of the InventDim fields become editable. Is this possible ? Does anyone know of an existing form extension where this has been done?

00680.Capture.PNG

Thanks,
Joe

*This post is locked for comments

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    301,109 Super User 2025 Season 2 on at

    Hi Joe,

    Can you start with providing some more information? What properties are used on the form datasource?

    I also wonder what would be reason to have the InventDim linked to the Serial numbers. Usually the serial number is used at a certain InventDim record as part of a transaction. The same serial number can be used on multiple InventDim records depending on e.g. inventory movements. What record are you actually showing then?

  • JoeBrewer Profile Picture
    692 on at

    Hi André

    Here are the properties that I have changed for the InventDim datasource:

    Allow create: No

    Allow delete: No

    Insert at end: No

    Insert if empty: No

    Allow check: No

    Table: InventDim

    On the InventSerial extension I have added a form part and given it the menu item name of my new form. I have then added a link that linked the new InventDimId field on the InventSerial table to the InventDimId field on the InventDim record.

    Thanks,

    Joe

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    301,109 Super User 2025 Season 2 on at

    Hi Joe,

    It is not possible at all to maintain the fields in this table directly. When this table is used on forms, like sales order lines, then the table is specially handled. This because it is not allowed to change the values on existing records. If you do so, also posted transactions will be "updated" with the changes.

    Other forms are trying to find an existing inventDim record based on entry or creates a new one when needed. So you would have to do it in the same way as other forms.

  • JoeBrewer Profile Picture
    692 on at

    Hi André

    The issue is that if I add the InventDim table as a datasource to a form extension I cannot stop the create method - the super() call is normally commented out in the create method. In a form extension it doesnt seem possible to do this. The original blog post at the top hinted at a way that this could be done.

    Joe

  • André Arnaud de Calavon Profile Picture
    301,109 Super User 2025 Season 2 on at

    Hi Joe,

    I haven't looked at the option to extend forms using form parts myself. Probably the author can assist on this? Ievgen is also a volunteer on this forum.

  • Verified answer
    Mea_ Profile Picture
    60,284 on at

    Hi Joe Brewer,

    To make form part editable please use next code:

    Declare variable for parent form:

    FormRun hostForm;

    Override init of the form part

    public void init()
    {
        hostForm = element.args().caller();
    
        super();
    
        if (hostForm)
        {
            hostForm.onTask += EventHandler(this.updateFormViewMode);
        }
    }


    implement updateFormViewMode method

     private void updateFormViewMode(FormRun _hostForm, int _taskId)
     {
        if (_taskId == #taskEditRecord || _taskId == #taskDoneEditRecord)
        {
            this.task(_taskId);
        }
     }


    I took this code from LogisticsPostalAddressGrid, it has other interesting functionality, so it's worth to look at it.

  • JoeBrewer Profile Picture
    692 on at

    Thanks so much for taking the time to help Ievgen. I really appreciate it

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans