Personalized Community is here!
Quickly customize your community to find the content you seek.
Have questions on moving to the cloud? Visit the Dynamics 365 Migration Community today! Microsoft’s extensive network of Dynamics AX and Dynamics CRM experts can help.
2022 Release Wave 1 PlanDynamics 365 release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.
2022 release wave 1 plan
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Community | FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Upcoming TechTalks | All TechTalks
I'm working in AX 365, I want to disable the Menu Item Button "SalesCreditNoteHeader" that is located in the (Sell > Create > Credit Note) pane of the SalesTable form, depending on certain condition.
I tried creating an event handler class with the following code:
[FormDataSourceEventHandler(formDataSourceStr(SalesTable, SalesTable), FormDataSourceEventType::Activated)]
public static void SalesTable_OnActivated(FormDataSource sender, FormDataSourceEventArgs e)
FormRun element = sender.formRun();
FormControl creditNoteButton = element.design().controlName("SalesCreditNoteHeader");
I debugged the class, and the if statements work correctly, but when the code enters to the else statement, the button is not being disabled.
I found that there's another class called "SalesTableInteraction" that can changes the "enabled" property of the button too.
How could I disable the button by code?
You could do it by Creating a CoC on enableHeaderActions method in SalesTableInteraction class as there is logic for enabling disabling the button in this class. However, it depends on the condition you are using. We need to be able to replicate the same logic in this class or the related classes.
Business Applications communities