Skip to main content

Notifications

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

How to deal with formReferenceControl?

(0) ShareShare
ReportReport
Posted on by 1,550

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
    Martin Dráb 230,842 Most Valuable Professional on at
    RE: How to deal with formReferenceControl?

    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

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,969 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,842 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans