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 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

I have the same question (0)
  • Suggested answer
    huijij Profile Picture
    19,811 on at

    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

  • Suggested answer
    GirishS Profile Picture
    27,827 Moderator on at

    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.

  • Verified answer
    Martin Dráb Profile Picture
    237,740 Most Valuable Professional on at

    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));

  • Verified answer
    huijij Profile Picture
    19,811 on at

    Hi Carlos,

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

    3757.Capture.PNG163388.png

  • Carlos Tena Profile Picture
    5 on at

    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));

       }

  • Martin Dráb Profile Picture
    237,740 Most Valuable Professional on at

    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).

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 700 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 408 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans