Hi Experts,
I have an issue while trying to use data sync functionality to copy data from one application to another.
Issue seems to generate due to a custom "before import" script which checks POV period with file period.
Can i change the script below so that it does not runs for data sync location/ for specific data load rule?
#----------------------------------------------------------------------
# Import section
#----------------------------------------------------------------------
from codecs import open
from os import path
#----------------------------------------------------------------------
# Context
#----------------------------------------------------------------------
fileName = fdmContext["FILENAME"]
locName = fdmContext["LOCNAME"]
inboxDir = fdmContext["INBOXDIR"]
periodKey = str(fdmContext["PERIODKEY"])
#----------------------------------------------------------------------
# Constant section
#----------------------------------------------------------------------
POVMarker = "Year to date as of "
dictPOVMarker = {
"Argentina": "PERIOD :"
}
#----------------------------------------------------------------------
# Event script code
#----------------------------------------------------------------------
# open source file and read header
msg = ""
if fileName.find(".xls") < 0:
filePath = path.join(inboxDir, locName, fileName)
try:
oFile = open(filePath, "r")
fdmAPI.logDebug("File %s opened" %(filePath))
except:
fdmAPI.logInfo("Error opening file %s" %(filePath))
line = oFile.readline().strip()
# get details from POV
# sample line looks like Year to date as of 08-2018'
POVMarker = dictPOVMarker.get(locName, POVMarker)
position = line.find(POVMarker) + len(POVMarker)
if line.find(POVMarker) >= 0:
periodFile = line[position:position + 2]
yearFile = line[position + 3 :position + 7]
else:
errMsg = "File does not contain POV Marker"
fdmAPI.showCustomMessage(errMsg)