Quantcast
Viewing all articles
Browse latest Browse all 48

FormObservableLink works in data source extensions

FormObservableLink class is useful for refreshing display and edit methods in D365FO. You create an instance variable of FormObservableLink type in a form, initialize it and call its observe() method in display/edit methods that you need to refresh on demand. When the refresh is required, you call markChanged() method of FormObservableLink and the system will rerun the methods and display new values. You can find more details in AX 7. Display methods and Form Observability, for instance.

I wondered if I can do the same in a data source extension and I wasn’t really sure that it would work. But it does – and the implementation is virtually the same as when building a whole form.

Here is a simple example:

[ExtensionOf(formDataSourceStr(smmContactPerson, ContactPerson))]
final class MySmmContactPerson_ContactPersonDs_Extension
{
    // Declare and initalize FormObservableLink
    private FormObservableLink observableLink = new FormObservableLink();
 
    edit NoYes myMethod(boolean _set, ContactPerson _contactPerson, NoYes _newValue)
    {
        // This says that observableLink will be able to refresh myMethod()
        observableLink.observe();
        ...
    }
 
    void refreshMethodsWhenSomethingHappened()
    {
        // Here we trigger a refresh
        observableLink.markChanged();
    }
}

Viewing all articles
Browse latest Browse all 48

Trending Articles


Re: Prosím o určení autora - google nepomáhá


Nelze se přihlásit na Facebook přes PC


Prodám Flexi pass - 3 200


Markéta Reinischová: Chceme s Filipem Jankovičem dítě!


Od: Martina


Podzemlje - epizoda 62


Defender


Plynový kotel DAKON DS 22G - 2 500


Gymnastické řemínky na hrazdu zn. Reisport, vel. č. 2: 590


P: NooK Soundelirium THE 12.6


Qube SP26 ( XTA DP226 ) signal processor - 12 000


Narovnání,vylisování bankovek


Javorina Holubyho chata


Tinylab: Tlačítka


Levasan Maxx není gel na klouby, nýbrž hnus


RNS315 couvací kamera


Kde najdu GameInput Service ve win 10?


Redmi Note 11 Pro+ 5G (PISSARO)


MV3 Vermona, Klingenthal, NDR


Hradcany 30h fialova razena 11 1/2 11 3/4