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



  • Martin Dráb Profile Picture
    241,656 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 245 Super User 2026 Season 2

#2
Aayush Tiwari Profile Picture

Aayush Tiwari 227

#3
Subra Profile Picture

Subra 184 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans