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 :
Finance | Project Operations, Human Resources, ...
Answered

How to create a form reference group control on batch job dialog

(3) ShareShare
ReportReport
Posted on by 269
Hello all, 
Hope you are all fine and well health,
I've a problem creating a form reference group control on batch job 
I want the code of the employment category to appear instead of the recid like the normal grid cell,
A way i use was Runbase batch instead of sysOperation framework mentioned here by Kevin: 
Dynamics Ax RunBase overriding dialog with a Form – Kevin's blog
But i have another problem which was making the batch job work, because it hangs a lot sometimes it works in batch queue and other times it works immediately without batch processing neglecting the batch processing check box is enabled or not so i try to use sysOperation 
Categories:
I have the same question (1)
  • Verified answer
    André Arnaud de Calavon Profile Picture
    300,915 Super User 2025 Season 2 on at
    Hi,
     
    Can you provide us with technical details how you currently added the employment category field on the dialog? What extended data type did you use? Have you tried the EDT BenefitEmploymentCategoryId?
  • Verified answer
    Saalim Ansari Profile Picture
    666 on at
    Hii,
     
    To address your issues with form reference group control and batch job inconsistency using RunBaseBatch, I'll break it down and guide you toward a cleaner and more robust implementation using SysOperation Framework, which is the recommended way in modern D365FO development.
  • MS-29011540-0 Profile Picture
    269 on at
    @André Arnaud de Calavon I used BenefitEmploymentCategoryRecId EDT because Recid is the unique identifier for employment categories, but the ID can duplicate
  • Martin Dráb Profile Picture
    237,805 Most Valuable Professional on at
    You can debug the code to see why it didn't create a reference group as expected. This is in DialogField.addControlToDialog():
    case Types::Int64:
        if (dictType)
        {
            tableName = dictType.lookupTable(true);
            if (tableName)
            {
                dictTable = DictTable::construct(tableName);
            }
        }            
    
        if (dictTable && dictTable.hasSurrogateKey())
        {
            buildControl = addControl(FormControlType::ReferenceGroup);                    
        }
        else
        {
            buildControl = addControl(FormControlType::Int64);
        }
    BenefitEmploymentCategory table doesn't seem to have SurrogateKey, therefore the condition for dictTable.hasSurrogateKey() is likely the reason why a reference group isn't used.
  • MS-29011540-0 Profile Picture
    269 on at
     @Martin Dráb Yes the table index isn't SurrogateKey but when i put the same EDT on form it works as a reference group but on dialogs it isn't,
    Isn't there a way to make it work as a reference group on dialog?
  • Verified answer
    Martin Dráb Profile Picture
    237,805 Most Valuable Professional on at
    Indeed, forms are a different scenario than the dialog. When creating a form, you add form controls in Visual Studio, while here we're talking about code adding form controls at runtime.
     
    I'll assume that my idea is right and the condition for dictTable.hasSurrogateKey() is the reason why the reference group isn't added. Then you have several options. For example, you can create a child of DialogField class, implement control adding in a different way and extend Dialog.addField() to use your class instead of the standard one. Or you could use a modeled form instead of the runtime dialog (the RunBase framework supports it).
  • MS-29011540-0 Profile Picture
    269 on at
    @Martin Dráb Ok thanks a lot i would try that <3

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 522 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans