Friday 8 February 2019

ACTIVE METHODS IN D365 FORM EVENT HANDLER FormDataSourceEventType::Activated

ACTIVE METHOD IN D365 ENVENT HANDLER CODE

WRITE THE BELOW CODE IN NEW CLASS OR ANY OTHER CLASS.
MAKE SURE THAT YOU USE THE METHOD SIGNATURE PROPERLY.

EXAMPLE
class CustTableFormEventHandler
{
    [FormDataSourceEventHandler(formDataSourceStr(CustTable, CustTable), FormDataSourceEventType::Activated)]
    public static void CustTable_OnActivated(FormDataSource sender, FormDataSourceEventArgs e)
    {
        CustTable           custTable     = sender.cursor(); //selected record
        FormDataSource      custTable_ds  = sender.formRun().dataSource("CustTable"); //DataSource 
        FormRun             element       = sender.formRun(); //form element
        FormControl         myNewButton   = element.design(0).controlName("MyNewButton"); 
//button on the form
        myNewButton.enabled(false); // enabled or disabled the button
    }
}


Thanks,
Vikas Mehta

No comments:

Post a Comment

AZURE INTERVIEW QUESTIONS AND ANSWERS

AZURE INTERVIEW QUESTIONS AND ANSWERES 2021 2. What is cloud computing? Explanation:  It is the use of servers on the internet to “store...