taPOTaxWrapper

We had an overseas client call for help with a failing eConnect integration, it was failing with essentially no error at all. 

The last time this happened, it was because of an error in an Multi Currency trigger in the Dynamics database, today's error turned out to be a missing currency line in DYNAMICS..MC00200. The trick was finding the error, because it wasn't being reported. 

We had the XML, and it had three call: PO Line, PO Header, and PO tax. We already have 'wrapper' code on this site for the first two so I wrote the wrapper below for the tax call and sent it to them. 

We copied the XML into the three stored procedure wrapper calls and we got the error on the header: error on the MCValidate stored procedure. And... an error number. I looked up the number and it was 'missing MC00200 line'. Grrr. 

Hope this helps. 

IF EXISTS (SELECT name
       FROM   sysobjects
       WHERE  name = N'taPOTaxWrapper'
       AND    type = 'P')
    DROP PROCEDURE taPOTaxWrapper
GO
    
CREATE PROCEDURE taPOTaxWrapper
    
-- EXEC taPOTaxWrapper 'anu090486',16384, '0%', '251556'
 
   
@PONUMBER varchar(20),
@ORD INT,
@TAXDTLID VARCHAR(15),
@VENDORID VARCHAR(15)
   
AS
    
set transaction isolation level read uncommitted
   
DECLARE @O_iErrorState INT,
    @oErrString VARCHAR(256),
    @ErrorDesc VARCHAR(256)
    
SELECT @O_iErrorState = 0,
    @O_iErrorState = ''
    
EXEC taPopIvcTaxInsert
    @I_vPONUMBER = @PONUMBER,
    @I_vORD  = @ORD,
    @I_vTAXDTLID = @TAXDTLID,
    @I_vVENDORID = @VENDORID,
    @O_iErrorState = @O_iErrorState OUT,
    @oErrString = @oErrString OUT
    
IF @O_iErrorState > 0 BEGIN
    SELECT @ErrorDesc = tec.ErrorDesc
        FROM dynamics..taErrorCode tec
        WHERE tec.ErrorCode = @O_iErrorState
END ELSE BEGIN
    SELECT @ErrorDesc = ''
end
    
    
SELECT @O_iErrorState AS ErrorState, @oErrString AS ErrString, @ErrorDesc AS ErrorDesc
-- SELECT * FROM POP10110 WHERE PONUMBER = @PONUMBER
    
    
GO
    
grant exec on taPOTaxWrapper to public


RealWorldCode gives developers practical, real‑world solutions with clean, working code — no fluff, no theory, just answers.
Links
Home
Knowledge Areas
Sitemap
Contact
Et cetera
Privacy Policy
Terms and Conditions
Cookie Preferences