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
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.
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).
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));
}
Hi Carlos,
There is indeed a function ReplacementFieldGroup() for doing this,
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));
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.
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
André Arnaud de Cal...
291,971
Super User 2025 Season 1
Martin Dráb
230,846
Most Valuable Professional
nmaenpaa
101,156