From: C. D. H. <Du...@Du...> - 2006-11-13 19:29:08
|
Ted Onley wrote: > I've written some scripts to import customer orders and purchase orders, but > they use the API. If you don't use the API, then you are bypassing all the > business rules built into SQL-Ledger. There are also many validation checks > done in the API to maintain data integrity. It may be a little more work > shelling out and running a script to use the API, but the amount of work you may > face fixing data integrity issue may far out weigh the work required on an API > call. > I have several shell scripts that load invoices & pos, and which print pick lists. I'm in the process of moving them all to LWP::UserAgent. The way I see it I'm safer with LWP then I am with the API - the API requirements are far more likely to change then the screens are. Even if the screens do change then it's pretty straight forward updating the Perl script. Also, I agree that it's better to not have to shell to call the API as that's just another point of failure. It's also difficult to determine whether the API call actually worked or not. I think there was some talk, along time ago, about a Perl module for SQL-Ledger, but that would get outdated in no time. LWP, in my opinion, is a better fit. Dunc |