Skip to main content

Notifications

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

How to modify replacementFieldGroup property of reference control in UI Builder class?

(0) ShareShare
ReportReport
Posted on by 5

Hi, I have a contract class with a reference control that shows the fiscal calendar period. This control has a lookup and when a record is selected, it displays the selected record with 3 fields like this

pastedimage1682436439623v2.png

I need to modify the replacement field group property of the reference control in UI Builder class to show only one field. Is it possible? I know that in a form you can choose the displayed fields changing the property replacement field group.

 pastedimage1682435980214v1.png

  • Martin Dráb Profile Picture
    Martin Dráb 230,846 Most Valuable Professional on at
    RE: How to modify replacementFieldGroup property of reference control in UI Builder class?

    Re-posted with correct indentation and line spacing:

    public void build()
    {
    	super();
    
    	df_fiscalCalendarPeriodRecId = this.bindInfo().getDialogField(
    		this.dataContractObject(),
    		methodStr(GeneratePortfolioProposalContractIND, parmFiscalCalendarPeriodRecId));
    
    	FormBuildReferenceGroupControl refGroupControl = df_fiscalCalendarPeriodRecId.control();
    	refGroupControl.replacementFieldGroup(tableFieldGroupStr(FiscalCalendarPeriod, FiscalPeriod));
    }

    Please always use Insert > Code (in the rich-formatting view).

  • Carlos Tena Profile Picture
    Carlos Tena 5 on at
    RE: How to modify replacementFieldGroup property of reference control in UI Builder class?

    Thank you Martin, this is what I needed.

    Here is the code I wrote:

    public void build()

       {

           super();

           df_fiscalCalendarPeriodRecId        = this.bindInfo().getDialogField(this.dataContractObject(), methodStr(GeneratePortfolioProposalContractIND, parmFiscalCalendarPeriodRecId));

           FormBuildReferenceGroupControl formBuildReferenceGroupControl = df_fiscalCalendarPeriodRecId.control();

           formBuildReferenceGroupControl.replacementFieldGroup(tableFieldGroupStr(FiscalCalendarPeriod, FiscalPeriod));

       }

  • Verified answer
    huijij Profile Picture
    huijij 19,811 on at
    RE: How to modify replacementFieldGroup property of reference control in UI Builder class?

    Hi Carlos,

    There is indeed a function ReplacementFieldGroup() for doing this, 

    3757.Capture.PNG163388.png

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,846 Most Valuable Professional on at
    RE: How to modify replacementFieldGroup property of reference control in UI Builder class?

    You should be able to pass a value to replacementFieldGroup() method of FormReferenceGroupControl.

    Here is (the only) example from the standard application:

    referenceGroupControl.replacementFieldGroup(tableFieldGroupStr(FinTag, DisplayValue));

  • Suggested answer
    GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: How to modify replacementFieldGroup property of reference control in UI Builder class?

    Hi Carlos,

    It cannot be done using any property or through code.

    You need to override the lookup method to show only single fields to.

    If it doesn't work add a string control and add a look up to it.

    Thanks,

    Girish S.

  • Suggested answer
    huijij Profile Picture
    huijij 19,811 on at
    RE: How to modify replacementFieldGroup property of reference control in UI Builder class?

    Hi Carlos,

    Please check the old thread for the same topic:

    community.dynamics.com/.../how-to-use-lookup-form-in-ui-builder-and-get-recid

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

Announcing Our 2025 Season 1 Super Users!

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

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,971 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,846 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans