10-31-2017 7:51 PM - edited 02-04-2024 1:44 AM
I am looking for a way to automatically run some code when a user field is updated. Basically, I want to insert current Order details into another database and send an email/sms when a user field called U_Approved is changed from 0 to 1. Any idea how to make that in dotNet c# without the use of SQL listeners?
Hi Waseem,
I recommend a console application, that you run in a scheduled task on the server. You could use the following steps:
If the other database is not a SAP Business One database, you do not even need the DI API.
Regards,
Johan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You're suggestion is plausible and is based on periodic pull base. This is the most reliable way to do it and prevents any losses in between. SQL dependency is another alternative and there seem to be also built in listeners in SAP as outlined here SAP Business One DI Event Service.
Hi Waseem,
The thing with this type of SAP technology is that it is not usually terribly stable, and that you are bound to spend a lot of time getting it to work the first time, and every time you upgrade the system. Next you'll spend a lot of time on trouble shooting after any and every little hickup in your network, DNS, DHCP, firewall, etc, and finally to get it to bend to your specific requirements. And all over again, when you get new server hardware.
Another argument (don't tell SAP I said this), is that if you ever decide to migrate to another ERP system, my solution only requires you to make a few minor changes to a query, whereas you would have to uninstall the SAP event service, and implement (or pay for) an entirely new solution.
Regards,
Johan
It is quite interesting that even built in features of SAP B1 itself are built to use a periodic pull solutions and not event listeners: example SAP mailer which sends emails at pre- defined intervals (e.g. 30 seconds), not instantly.
Good observation. It may have something to do with the fact that B1 is very much a database driven application.
When you add a document, the client really only runs one or more stored procedures. Also SAP generally advises against adding triggers to the database.
Implementing an event listener on one machine to listen to events on possibly another machine, and then on a third party database software, may be a challenge.
User | Count |
---|---|
92 | |
11 | |
10 | |
6 | |
5 | |
5 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.