Alfasith AX

Alfasith AX
اللَّهُمَّ انْفَعْنِي بِمَا عَلَّمْتَنِي، وَعَلِّمْنِي مَا يَنْفَعُنِي، وَزِدْنِي عِلْمًا

Tuesday, June 21, 2022

Calling custom method of other layer objects created in form level in D365

 Hi,


Using an event handler, we cannot call the custom methods created in another later / model/ ISV object. 

On calling formRun.CreateDeliveryNote()  throws the error ‘FormRun doesn't have the method CreateDeliveryNote.

FormDataSource purchTable_ds = sender.datasource();
FormRun formRun = purchTable_ds.formRun();
formRun.CreateDeliveryNote() ;

Conclusion is to use only COC not eventhandler

[ExtensionOf(formDataFieldStr(PurchTable, PurchTable, DeliveryDate))]
final class PurchTableDeliveryDateField_Extension
{
    public void modified()
    {
         next modified();
         element.CreateDeliveryNote(); // Custom method from Other Later / Model 
    }
}


Regards

Sunday, June 19, 2022

Exdends property of D365

Hi,


To know the ISV objects implications.


[ExtensionOf(classStr(ClassToExtend))] - class

[ExtensionOf(formstr(FormToExtend))] - Forms and its methods

[ExtensionOf(formdatasourcestr(FormToExtend, DataSource1))] - Form Datasource and its methods

[ExtensionOf(formdatafieldstr(FormToExtend, DataSource1, Field1))] - Form Datasource fileds and its methods

[ExtensionOf(formControlStr(FormToExtend, Button1))] - Form Object and its methods

[ExtensionOf(tablestr(TableToExtend))] - Table methods

[ExtensionOf(tableStr(DataEntityToExtend))] - Entity methods


Regards,

How to invoke and iterate List as Contract methods in AX 2012/ D365

Hi, Public void performContractIterate(ClassContainsListAsContract    _ListCarryClass) { List contractFieldList = new List(Types::Class); ...