RS First Dynamics NAV Blog


...from NAV 3.60 to NAV 2013
Archivio Posts
Anno 2015

Anno 2014

Anno 2013

Anno 2012

Anno 2011

Anno 2010

Anno 2009

Anno 2008

Anno 2007

Web Service NAV 2009 Test Page Data Writing

Ho fatto un po di prove di gestione degli errori con i web services di NAV 2009 e in tutti i test che ho fatto gli errori del sistema vengono passati in modo trasparente al Web Service, vengono restituiti gli esatti messaggi di errore sia tramite i metodi standard delle page sia con le codeunit custom.

 

NO ROLLBACK:

Non sono però riuscito a fare in modo che non venga incrementato il numero di serie degli ordini in caso di errore, in pratica se l'ordine va in errore su una qualsiasi riga (ad esempio articolo bloccato) non riesco a fare in modo che non venga staccata una testata d'ordine vuota. Questo utilizzando i metodi standard di NAV 2009, arghhhh !!!!

 

TO DO:

... devo riuscire a gestire il rollback !!!

 

-> SOLUZIONI

soluzione
ho trovato feedback su altro forum da ara3n, David Singleton,kriki  per lo stesso post inserito da un mio collega  (l'abbiamo messo 2 volte per capire in quale si risponde prima)

liks risposte  che riassumo

http://www.mibuso.com/forum/viewtopic.php?f=32&t=39627&start=0&sid=ef63af836269757097fd8f4913360b32

 

1a ipotesi

1) webservice NAV2009 (the original without hotfix) has a bug: the COMMIT command does NOT do a COMMIT!

2) otherwise : search where the COMMIT is, and do a test:

IF NOT ISSERVICETIER THEN
  COMMIT;

 

The problem is: you have to find all COMMIT. And if later on, someone adds a commit,.....

2a ipotesi
Is one transaction and it is being called twice, hence two transactions.
These are the options.

1. Delete the any records created if you get any error. (rollback manuale)

2. Write the data into staging table and call a NAV function to create the orders and if errors out to delete the data from staging table.

3. Create a codeunit with a function and pass XMLport as paramter. I haven't tried this yet.  -> come per la versione precedente per NAV 5.0

 2. Write the data into staging table and call a NAV function to create the SO and if errors out to delete the data from staging table.

-> This is what I would suggest also. Though I would not delete the data if there is an error, I would add a status field and mark the order as failed, this gives you an audit trail and lets the user check what went wrong, Then once resolved, flush out the old data.

se avete altre idee. grazie.

 

lunedì, 25 gen 2010 Ore. 20.13

Messaggi collegati


Statistiche
  • Views Home Page: 451.141
  • Views Posts: 863.584
  • Views Gallerie: 0
  • n° Posts: 343
  • n° Commenti: 0
Copyright © 2002-2007 - Blogs 2.0
dotNetHell.it | Home Page Blogs
ASP.NET 2.0 Windows 2003