Wednesday, 12 August 2020

DataEventType::MappedEntityToDataSource in D365

DataEventType::MappedEntityToDataSource in D365

[DataEventHandler(tableStr(MyTableEntity), DataEventType::MappedEntityToDataSource)]

public static void MyTableEntity_onMappedEntityToDataSource(Common _sender, DataEventArgs _eventArgs)

{

    DataEntityContextEventArgs eventArgs = _eventArgs;

    MyTableEntity entity = _sender;

    if (eventArgs.parmEntityDataSourceContext().name() == dataEntityDataSourceStr(MyTableEntity, MyTable))

    {

        MyTable myTable = eventArgs.parmEntityDataSourceContext().getBuffer();

        ... write your logic here

    }

}


Thanks,

Vikas  Mehta.

No comments:

Post a Comment

Blog Post 6: Bonus – Building Your First Custom Copilot Plugin in X++

Blog Post 6: Bonus – Building Your First Custom Copilot Plugin in X++  Introduction In our previous posts, we explored what Copilot can do o...