Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Unanswered

DialogField bound with parm method of RefRecId type, but a Int64 control is build.

Posted on by 10
Hi Experts,
 
I am facing a strange issue with DialogField.
 
The following method is in contract class
 
    public DWFS_FilmFabricCountryOrigRecId parmFabricCountryOrig(DWFS_FilmFabricCountryOrigRecId _fabricCountryOrig = fabricCountryOrig)
    {
        fabricCountryOrig = _fabricCountryOrig;
        return fabricCountryOrig;
    }
 
The EDT DWFS_FilmFabricCountryOrigRecId is extends RefRecId, and the Reference Table is set. I am sure that the settings are correct because when I drag this EDT to table, relation will be added automatically.
 
However, when a DialogField is bound with this method in UIBuilder class, a FormInt64Control is generated instead of a FormReferenceControl.
 
Can anyone tell me what I am missing?
 
Thanks.
  • DialogField bound with parm method of RefRecId type, but a Int64 control is build.

    I got a bit curious and had a play. If the reference group is generated with you add the field to a table, then it should work.


    Is this what you are seeing?

    Is the dialog also broken? I.e. can you see the reference group.

     

    My best guess is that it's either a cache issue, or a full compilation of the model is needed.

     

    These are my example classes:

    [
        DataContract,
        SysOperationContractProcessing(classStr(TestServiceUIBuilder))
    ]
    internal final class TestServiceContract
    {
        InventPackagingUnitRefRecId packUnitRefRecId;
        [DataMember]
        public InventPackagingUnitRefRecId parmPackUnit(InventPackagingUnitRefRecId _packUnitRefRecId = packUnitRefRecId)
        {
            packUnitRefRecId = _packUnitRefRecId;
            return packUnitRefRecId;
        }
    }
     
    internal final class TestServiceUIBuilder extends SysOperationAutomaticUIBuilder
    {
        private DialogField packUnitField;
        public void postBuild()
        {
            super();
            // Get reference to packUnitField dialog field
            packUnitField = this.bindInfo().getDialogField(this.dataContractObject(), methodStr(TestServiceContract, parmPackUnit));
            
            FormBuildReferenceGroupControl ctrl = packUnitField.control();
        }
    }


     
  • Anton Venter Profile Picture
    Anton Venter 18,530 Super User 2024 Season 2 on at
    DialogField bound with parm method of RefRecId type, but a Int64 control is build.
    I have not investigated this and I have not faced this before so I don't have an answer to your question about why the system is not adding the ref. group control automatically. However, I have some suggestions as a work around. Perhaps you can override a method your UIBuilder class to manually add this field or create a custom form as your dialog.

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,532 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,501 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans