Friday, March 5, 2021

Observer x++ D365FO

 Observer

Observer pattern is used when there is one-to-many relationship between objects such as if one object is modified. Its dependent objects are to be notified automatically.

Most common example for observer is Display methods.

Example: 1

Object: SalesTable (form)



Form Display method

Based on mentioned in FORMOBSERVABLE attribute to global declared variables, System keep on observer any changes on this. In case if any changes then it will trigger logic wherever its called on display methods.

Example: 2

Object: ReturnReplaceItem(form)



Based on mentioned in _ds.observer() for data source, System keep on observer any changes on Ds object. In case if any changes then it will trigger logic wherever it’s called on display methods.

Example: 3

Object: PurchTable (Form)




We can say to system like as calling markChanged() action is mentioned, whenever it gets changed in case variables wherever workflowIconObservableLink.observe() is called system will refresh automatically.






Convert Call stack to readable format in D365FO X++

//Input --container _xppCallStack = xSession::xppCallStack();  Public static str POL_formatXppCallStack(container _xppCallStack, int _skipFr...