Mark File Ready and Archive

Sample Stored Procedure to Mark EDI Files as Ready:



CREATE PROCEDURE [dbo].[spEDIMarkNewAsReady]

AS

 

UPDATE p

SET StatusID = 2 

FROM EDI_POHeader p

INNER JOIN ##tmpEDIFiles t ON t.FileID = p.FileID

WHERE p.StatusID = 1 

 

UPDATE f

SET StatusID = 2 

FROM EDI_File f

INNER JOIN ##tmpEDIFiles t ON t.FileID = f.FileID

WHERE f.StatusID = 1 

 

 

SELECT FilePath + '\' + FileName as FileSource, 'C:\ERPEDI\Archive\' + FileName as FileDestination FROM ##tmpEDIFiles

 

DROP TABLE ##tmpEDIFiles

 

GO

 

ImportExportMap Records:
 

fkImportExportStep

SourceField

DestinationField

fkImportExportDestinationType

InternalMethodArgumentOrder

fkImportExportStep

SourceField

DestinationField

fkImportExportDestinationType

InternalMethodArgumentOrder

(Step ID)

FileSource

sourceFilePathAndName

2 (for String)

1

(Step ID)

FileDestination

destinationFilePathAndName

2 (for String)

2

* SourceField values must match that of the column names being returned from the Stored Procedure (see sample above)

* DestinationField values must exactly as shown as are expected fields from ERP.