web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

How to deal with formReferenceControl?

(0) ShareShare
ReportReport
Posted on by 1,552

Hi,

I have a stringFormControl and FormReferenceGroupControl
and i'm trying to do the same things for both controls but I'm getting an error for the reference group

1. For caseCategory Y, I'm getting object reference error in the UI
 

FormStringControl caseCategoryX = sender.formRun().design().controlName(formControlStr(CaseDetailCreate, CaseCategoryX)) as FormStringControl;
FormReferenceControl caseCategoryY = sender.formRun().design().controlName(FormReferenceControl(CaseDetailCreate, CaseCategoryY)) as FormReferenceControl;

2. text(null) not working for caseCategoryY

caseCategory2.text(null);
caseCategory3.text(null);



I have the same question (0)
  • Martin Dráb Profile Picture
    238,751 Most Valuable Professional on at

    1. My assumption is that you gave us wrong information and the exception doesn't get thrown at this line. I think you assign null to caseCategoryY and you'll get an exception later when you try to call a method on caseCategoryY variable. Is it so? If not, then please tell us which call throws the exception. Use the debugger if you haven't done it yet.

    2. "Not working" isn't a good description of any problem. I'm assuming that you a compilation error telling you that FormReferenceControl class doesn't have any text() method. You can use value() method instead. Note that FormReferenceGroupControl isn't a text control - it expects a record ID.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 510 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 399

#3
Adis Profile Picture

Adis 251 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans