Data change notifications - what are my options?

Get our Free Newletter

Don't you have the time to be online here at DUG every day? So how do you follow what is going on in the Dynamics industry and community?
If you subscribe to the DUG Newsletter then you can relax! We will make sure that you don't miss the big news!

Check out our
Newsletter Subscription Center
page a complete list of our different newsletters.

Solution (Verified) This post has 1 verified solution | 9 Replies | 2 Followers

Not Ranked
5 Posts
125 Points
Joined: Apr 17, 2009
Last Online:
May 14, 2009 11:23
Location: Chicago
Alucard posted on Apr 17, 2009 13:07
How helpful was this post/question? Please rate here:

Hello,

I'm developing a custom software, working with data coming from Axapta 3.0 SP3. I would like to be able to receive program notifications when records of needed types are changed within Axapta. What are my options here? I wouldn't like to employ third-party solutions.

Thank you.

Solution (Verified) Verified Solution

Top 25 Contributor
Male
749 Posts
8,199 Points
Joined: Jan 21, 2003
Last Online:
Mar 19, 2010 11:43
Location: Herts, England
DynamicsAXMVP
Moderator
Solution (Verified) Harish Mohanbabu replied on Apr 23, 2009 19:25
How helpful was this comment/solution? Please rate here:
Verified by Alucard

Alucard:
Does axapta perform bulk inserts on general basis? If this is a special case, we could live with that. Is it true that to be able to capture update events for sure on business level, we would have to override both Update/DoUpdate methods, or is there something more to it?

Answer is yes.  Array inserts for instance are used in many parts of system to update various areas.  Examples are master planning, inventory adjustment etc.

Answer is no.  You cannot override methods like doUpdate, doInsert etc.

Alucard:
The database approach is very attractive, although how is it in regard to axapta best practices? For realtime we could add triggers to interested tables and call an external dll from stored procedure to notify our software.

Seeing that you are essentially after pure data and that you are not going to run any business logic inside Ax, best practice guidelines should not be an issue here.

Hope this helps, 

Harish Mohanbabu
Long way to go before I sleep ..

View Harish Mohanbabu's profile on LinkedIn

All Replies

Top 10 Contributor
Male
4,673 Posts
54,741 Points
Joined: Nov 3, 2000
Last Online:
Mar 20, 2010 13:56
Location: UK
DynamicsNAVMVP
Moderator
AdamRoue replied on Apr 17, 2009 13:33
How helpful was this comment/solution? Please rate here:

I am not sure of the format, but changes could be recorded in the database log or alerts can be configured, both of these would be considered user based ntoficiations of data changes.

The art of teaching is clarity and the art of learning is to listen

Don't forget to VERIFY the post(s) that solved your problem. This credits the experts who helped, earns you points and marks your thread as Resolved so we all know you have been helped.

Not Ranked
5 Posts
125 Points
Joined: Apr 17, 2009
Last Online:
May 14, 2009 11:23
Location: Chicago
Alucard replied on Apr 17, 2009 13:46
How helpful was this comment/solution? Please rate here:

Thank you for the answer. Log monitoring is feasible but requires some kind of translation from database objects to business objects. I guess, implementing some mechanism from within axapta would give better results in terms of types compliance and configuration changes survival. As far as I know, no alert service is available in axapta 3.0 sp3, am I wrong?

Top 10 Contributor
Male
4,673 Posts
54,741 Points
Joined: Nov 3, 2000
Last Online:
Mar 20, 2010 13:56
Location: UK
DynamicsNAVMVP
Moderator
AdamRoue replied on Apr 17, 2009 14:07
How helpful was this comment/solution? Please rate here:

I have only worked with 4 onwards, so yes that statement could be true but I cannot confirm it.

The art of teaching is clarity and the art of learning is to listen

Don't forget to VERIFY the post(s) that solved your problem. This credits the experts who helped, earns you points and marks your thread as Resolved so we all know you have been helped.

Top 25 Contributor
Male
749 Posts
8,199 Points
Joined: Jan 21, 2003
Last Online:
Mar 19, 2010 11:43
Location: Herts, England
DynamicsAXMVP
Moderator
Harish Mohanbabu replied on Apr 21, 2009 11:19
How helpful was this comment/solution? Please rate here:

Hello,

To confirm - alert service is not available in Dynamics Ax 3.0 version.  

To elaborate on log monitoring -

  • Let us assume a table has been set up for insert action under database log (Administration -> Setup -> Database log) 
  • When the above has been setup correctly, whenever a record is inserted into this table a call will be made to "logInsert" method in Application class.
  • Similarly for 'delete' action it will be 'logDelete' and for 'updates' it will be 'logUpdate' methods in the Application class.
  • Therefore through 'application' class, Ax 3.0 provides a hook for database related activities. 

Perhaps you might want to place your code under appropriate methods in 'Application' class.  Please note - depending on the volume, there will obviously be an overhead.

Hope this helps,

Harish Mohanbabu
Long way to go before I sleep ..

View Harish Mohanbabu's profile on LinkedIn

Not Ranked
5 Posts
125 Points
Joined: Apr 17, 2009
Last Online:
May 14, 2009 11:23
Location: Chicago
Alucard replied on Apr 21, 2009 12:06
How helpful was this comment/solution? Please rate here:

Thank you for your answer, it is very informative. The solution which I came upon is to override update delete and insert methods on each table I interested in and put changes information to a separate dedicated table, which then is read by polling from Axapta Business Connector. There are only about ten such tables, so it seems log monitoring in this case would indeed be too much.

Do you see there is something to be improved in my approach, given small number of monitored objects? Also is there a way to notify ABC client from inside Axapta?

Top 25 Contributor
Male
749 Posts
8,199 Points
Joined: Jan 21, 2003
Last Online:
Mar 19, 2010 11:43
Location: Herts, England
DynamicsAXMVP
Moderator
Harish Mohanbabu replied on Apr 21, 2009 14:47
How helpful was this comment/solution? Please rate here:

Hello,

In order to provide educated reply, I would require the actual table list.  

But generally speaking depending on type and nature of tables, there are some risks in overriding 'insert' methods at table level.

  • Let us assume one of the tables is of transactional type and used in scenarios like high volume import.  Then chances could be that records might get inserted into this table by 'array insert'.   It is done this way because array inserts speeds up insert operations exceptionally quicker.  But if the table's insert method is overrided, then it will fall back to standard record by record insert.
  • Other scenario could be - if insert takes place through 'doInsert' method, this will by pass 'insert' method on the table.  This will be applicable for 'doUpdate' and 'doDelete' methods as well i.e. 'update' and 'delete' methods will be by passed.

Regarding suggestions for improvement - if possible I would try to move this process into SQL Database. For example -

  • Tables in Ax contains properties like created date / time, modified date / time etc.  This property could be switched on for your list of tables
  • Subsequently in SQL, a stored procedure could be written to pick up data from these tables on regular interval.  With some little thinking, this could clevery written in such a way that it picks up only those records that were changed since last time SP was run

Obviously this might not provide real time benefit but could provide something close to that.

Hope this helps,

Harish Mohanbabu
Long way to go before I sleep ..

View Harish Mohanbabu's profile on LinkedIn

Not Ranked
5 Posts
125 Points
Joined: Apr 17, 2009
Last Online:
May 14, 2009 11:23
Location: Chicago
Alucard replied on Apr 22, 2009 11:09
How helpful was this comment/solution? Please rate here:

Thats a very valuable input, thank you very much. Entities I interested in are Customers, Customer Representatives, Goods, Prices, Stock and Orders. The software is supposed to list mentioned entities and place orders to axapta, which is rather popular type of project. There is an underlying database which should be maintaned in sync with axapta data.

Our initial intent  was actually implementing the logic on database level. Though, we have no previous experience in axapta and considered this approach a risk. Some systems perform massive database metadata change in response to configuration adjustments, so we decided to stay at (possibly) safer side and implement on business level.

Does axapta perform bulk inserts on general basis? If this is a special case, we could live with that. Is it true that to be able to capture update events for sure on business level, we would have to override both Update/DoUpdate methods, or is there something more to it?

The database approach is very attractive, although how is it in regard to axapta best practices? For realtime we could add triggers to interested tables and call an external dll from stored procedure to notify our software.

Top 25 Contributor
Male
749 Posts
8,199 Points
Joined: Jan 21, 2003
Last Online:
Mar 19, 2010 11:43
Location: Herts, England
DynamicsAXMVP
Moderator
Solution (Verified) Harish Mohanbabu replied on Apr 23, 2009 19:25
How helpful was this comment/solution? Please rate here:
Verified by Alucard

Alucard:
Does axapta perform bulk inserts on general basis? If this is a special case, we could live with that. Is it true that to be able to capture update events for sure on business level, we would have to override both Update/DoUpdate methods, or is there something more to it?

Answer is yes.  Array inserts for instance are used in many parts of system to update various areas.  Examples are master planning, inventory adjustment etc.

Answer is no.  You cannot override methods like doUpdate, doInsert etc.

Alucard:
The database approach is very attractive, although how is it in regard to axapta best practices? For realtime we could add triggers to interested tables and call an external dll from stored procedure to notify our software.

Seeing that you are essentially after pure data and that you are not going to run any business logic inside Ax, best practice guidelines should not be an issue here.

Hope this helps, 

Harish Mohanbabu
Long way to go before I sleep ..

View Harish Mohanbabu's profile on LinkedIn

Not Ranked
5 Posts
125 Points
Joined: Apr 17, 2009
Last Online:
May 14, 2009 11:23
Location: Chicago
Alucard replied on Apr 24, 2009 10:08
How helpful was this comment/solution? Please rate here:

Looks like the only consistent way to listen for changes is through database. We're probably still better off using business layer to place orders to axapta. Thank you very much for your help.

Page 1 of 1 (10 items) | Get this RSS feed | Bookmark and Share