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)

How to create a record on a form

(0) ShareShare
ReportReport
Posted on by

Hey guys,

I am fairly new to AX, and so far have worked on Extensions. This is my first try to build tables/form from scratch. I created to two Table LeavePlan and LeaveDetail and have added them to LeavePlan Form as FormDataSource. The tables are related as LeavePlan.RecId = LeaveDetail.LeavePlan. Both form datasource property InsertIfEmpty is set to No, LeaveDetail has the JoinSource property set to LeavePlan with LinkType Active (also tried Passive/Delayed/InnerJoin). The problem arises when running the form and I want to create a New record via CTRL+N or New button in ActionPane. It only creates record for LeavePlan (enables it's field controls on the form whilst LeaveDetail field controls are all still disabled). I tried overriding the createRecord function as

public void createRecord(str _formDataSourceName, boolean _append = true)

{

    str detailDataSourceName = formDataSourceStr(LeavePlan, LeaveDetail);



    super(_formDataSourceName, _append);

    super(detailDataSourceName, _append);

}

and 

public void createRecord(str _formDataSourceName, boolean _append = true)

{

    super(_formDataSourceName, _append);

    LeaveDetail_ds.create();

    LeaveDetail_ds.initValue();

}


In any case, the record wasn't created for LeaveDetail, and its fields are all disabled on the form even after clicking the New button in action pane. I even tried overriding task and It still didn't work. How do I resolve this issue?

*This post is locked for comments

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

    Hi Danyal,

    A similar situation is valid for the released product details form (EcoResProductDetailsExtended). You can verify the coding used on this form for the InventTable and InventTableModule (3 instances) datasources.

  • Community Member Profile Picture
    on at

    Danyal,

    Write your code for inserting in LeaveDetail table in LeavePlan Datasource's write( )  above super()[overriden method] in form with the related field from both the tables.

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