Hello,
I'm working in AX 2012 R3.
I'm updating the BatchJob Form.
I created a second table to add more fields to the BatchJob table.
The second table relates to BatchJob with relationshiptype = Composition.
In the form I have 2 datasources one for BatchJob and another for BatchJob_Extend table.
The BatchJob_Extend datasource has Batchjob as join datasource of type OuterJoin.
I then modified the grid to show fields from the new Batchjob_Extend table.
When I tried to modify a field in the new table and I move out of the record I get an error: "Field 'Reference' must be filled in.
If I play around with the join source settings I can get the records to be inserted but then the form doesn't load the data properly for the new fields.
Any help would be appreciated.
Hi Carlo,
I think it will be best for you to use table extension framework for this. Please check this post for an example of how to do this.
You can also check tables SalesLine and SalesLine_IN which have been designed in the same way.
Hi again.
It's there a way to stop the form to try to create the new record in BatchJob_Extend when I create a new record in BatchJob?
When I create the record I still have the same problem of missing reference but the BatchJob.RecId is still empty
Thank you GunJan.
I had to modify your suggestion and I ended up overwriting the ValidateWrite method in the datasource you recommend. I guess the sequence of events on the form was validating before doing the actual writing.
Hi Carlo,
You can override write method in the Batchjob_Extend datasource and populate the field using which you have linked it to BatchJob table.
public void write() { if (!batchJob_Extend.BatchJob) { batchJob_Extend.BatchJob = batchJob.RecId; } super(); }
This way the reference field will be populated in the new record.
André Arnaud de Cal...
291,979
Super User 2025 Season 1
Martin Dráb
230,848
Most Valuable Professional
nmaenpaa
101,156