Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Unanswered

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

(1) ShareShare
ReportReport
Posted on by 20
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,788 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,419 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,492 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans