Notifications
Announcements
No record found.
Hello,
Can someone tell me, how to call the clicked event of the command button through the code.
I would like perform some operation within the code so that user manually doesnt have to click the button.
How can i achieve through envent handler.
Thanks
Hi Jeff,
Can you please elaborate on your question.
Where you want to call the code on the clicked method.
Thanks,
Girish S.
I want to call click event of the button in lets say some form datasource method.
You can set the Auto declaration property of the command button control to Yes and then call ControlName.clicked().
Adding to Girish using formrun you can get the control and call the clicked method if control has auto declaration no.
Hi Jeff, I think Auto Declaration of command button cannot be changed in form extension for standard form. You can refer below code to access the command button via event handler. If you are using custom form then just change AutoDeclaration property of command button to Yes and access it directly in your code by control name.
[FormDataSourceEventHandler(formDataSourceStr(MyDialogForm, SalesLine), FormDataSourceEventType::Activated)] public static void SalesLine_OnActivated(FormDataSource sender, FormDataSourceEventArgs e) { FormCommandButtonControl okButton = sender.formRun().design().controlName(identifierStr(OK)); okButton.clicked(); }
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 660 Most Valuable Professional
André Arnaud de Cal... 549 Super User 2025 Season 2
Sohaib Cheema 307 User Group Leader