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)

Field 'Reference' must be filled in when updating row in grid on form?

(0) ShareShare
ReportReport
Posted on by 1,813

Hii,

I have created child table for CustInvoiceJour named CustInvoiceJour_Ext and Relation on RecId field.

I have AOT Query for these two tables.

I created a form and with query a data source.

When I update a record in the Grid and go to next row its giving error "Field 'Reference' must be filled in". 

If I remove CustInvoiceJour_Ext  datasource then I can update in CustInvoiceJour.

How I can Insert a record in CustInvoiceJour_Ext table if its not exist and only update when exist while editing row on Form Grid?

ackquery.png

ack2.png

getting same error when saving on the table...

fieldref1.png

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Mea_ Profile Picture
    60,284 on at

    Hi Rana Anees,

    When you save a record AX saves child datasource first and then parent. So there is no RecId allocated when new CustInvoiceJour_Ext  record get saved. To deal with this sort of relations you can use UnitOfWork, you can read this blog post to get yourself familiar with it daxmusings.codecrib.com/.../ax-2012-recids-and-unitofwork-foreign.html

    Literally you need to change "ChangeGroupMode" property on the "Data Sources" node in the form design to "ImplicitInnerOuter" and AX would save both records in the same time allocating RecId and using it as a FK.

    You can read more about  ChangeGroupMode here msdn.microsoft.com/.../jj129662.aspx

  • Rana Anees Profile Picture
    1,813 on at

    Not understanding how to implement UnitOfWork on CustInvoiceJour and CustInvoiceJour_Ext tables.

    Last option will be to add all new custom fields in CustInvoiceJour table.

    Feeling stuck.

  • Mea_ Profile Picture
    60,284 on at

    Did you try to change "ChangeGroupMode" property as I advised? 

  • Rana Anees Profile Picture
    1,813 on at

    Cant't find where is this property? Parent or Child Data source?

  • Mea_ Profile Picture
    60,284 on at

    One level up, it's a property on "Data sources" node, not on individual data source.

  • Rana Anees Profile Picture
    1,813 on at

    On datasource its set now

    ack4.png

    and OptionalRecordMode for data set is ImplicitCreate and its disabled...

    ack4.png

    Now I open the form and edit the child for field and leave the row and still getting the same error ... "Field 'Reference' must be filled in."

    whats next please..

  • Rana Anees Profile Picture
    1,813 on at

    Many posts are advising that follow three steps to implement UnitOfWork framework..

    Steps to enable unit of work

    1. Right click the data sources node in the Form and click properties to set the ChangeGroupMode to ImplicitInnerOuter.

    2. Then set the data sources joins

    3. Last step is to set the optional record mode. This step is set by default but The user can also control it. The property is responsible for controlling the create and delete behavior. You can do this by right clicking the specific data source and by choosing the property named as "OptionalRecordMode". This property can have three values

    Steps 1 and 3 I already set. But step 2, where to set it. My forms datasource us an AOT query and it already has OuterJoin with parent and child table.

    2. Then set the data sources joins (Where to set it please.)?

    Thanks,

  • Rana Anees Profile Picture
    1,813 on at

    Dear ievgen Miroshnikov, need your help please..

  • Mea_ Profile Picture
    60,284 on at

    And why do you have query there ? It's hard to help if all you have is 2 screenshots. 

  • Rana Anees Profile Picture
    1,813 on at

    Should I add direct tables as data sources on the form? Ok, I will remove the Query and add tables Parent and Child on the form.

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