Dear all,
I want to use the SBO_SP_PostTransactionNotice to run a query after an AR Invoice is added and have the results exported to an XML file.
Below is the query I have used in the stored procedure.
IF @object_type = '13' AND @transaction_type IN ('A','U') BEGIN DECLARE @FileName varchar(50), @bcpCommand varchar(2000) SET @FileName = REPLACE('C:\Test\AR_INVOICE_'+CONVERT(char(8),GETDATE(),1)+'.xml','/','-') SET @bcpCommand = 'bcp "select CardCode, CardName, DocDate, DocNum, DocTotal from SBODemoGB.dbo.OINV WHERE DocEntry = @list_of_cols_val_tab_del" queryout "' SET @bcpCommand = @bcpCommand + @FileName + '" -T -c' EXEC master..xp_cmdshell @bcpCommand END
But when I add the AR Invoice, this doesn't seem to run. I know the query works cause if I select an existing DocEntry number, I can export the file manually. But I would like this to run after every invoice is added.
Your help will be greatly appreciated.
Kind Regards,
Brian K. Maingi