Announcements
No record found.
Hi,
On the modified method of Field1, I want to first check the following:
[FormControlEventHandler(formControlStr(CaseDetailCreate, Field1), FormControlEventType::Modified)] public static void CaseCategory_OnModified(FormControl sender, FormControlEventArgs e) { formRun callerFormNum = sender.formRun().args().caller(); if(sender.formRun().args().callerName() == formstr(XXCustomerWorkspace) && XXcustomer.visible()) { XXcustomer.Text(i want to get the value of the control that is not bound to a datasource from the caller form); } }
Also, I'm getting error on firstLineUnable to cast object of type 'Dynamics.AX.Application.CaseDetailForm' to type 'Dynamics.AX.Application.FormRun'.'
Hi, In the first line, issue is that you have already mapped FormRun object with caller. Here caller is CaseDetailForm which is a class, not a Form. That's why system is throwing unable to cast object error.
First check if caller is a form, check this article
kiwiaxguy.blogspot.com/.../checking-to-see-if-caller-is-form.html
Hi Mohit,
I can see that the caller In both cases is "CaseDetailForm" class
But one is actually called from "CaseDetail" form
and one is called from XXCustomerWorkspace
So maybe i need to get the caller of the caller in this case to know if it's coming from standard form CaseDetail or my new customized form XXCustomerWorkspace? if yes how to do that?
Also the other part of the question:
i want to get the value of the control that is not bound to a datasource from the caller form
Hi, You can try below code you find caller of the caller form
FormRun callerFormRun = sender.formRun(); FormRun origCallerFormRun = callerFormRun.args().caller();
Regarding, accessing value of unbound form field, try accessing control from formRun.Design and accessing value of control.
https://community.dynamics.com/365/financeandoperations/f/dynamics-365-for-finance-and-operations-forum/398587/access-unbound-control-in-form-datasource-method-coc
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.
Congratulations to our 2026 Super Stars!
Thanks to all of our 2025 Community Spotlight stars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
André Arnaud de Cal... 521 Super User 2026 Season 1
Giorgio Bonacorsi 438
Adis 261 Super User 2026 Season 1