Muestra de script de importación

Este script de importación de ejemplo devuelve la ubicación como un valor para la columna.

#----------------------------------------------------------------
# Sample shows how to use the value from the fdmContext map, In
# this sample return the Location as value for the column
#----------------------------------------------------------------
def getOrgfromLoc(strfield, strrec):
    org = fdmContext['LOCNAME']
    return org
#------------------------------------------------------------------
# Sample to show the Jython string function. The script below is 
# used to parse an account column 01-205-4110-0000-000 and return the
# third string 
#------------------------------------------------------------------
def getSegfromAcct(strfield, strrec):
  if strfield.count("-") > 0:
    seglist = strfield.split('-')
    result = seglist[2]
    return result
#----------------------------------------------------------------
# Sample to process header record in Trial Balance report and
# store value in global variable to be used during detail row 
# This should be called from the Amount column in import format
#----------------------------------------------------------------
globalorg = ""
globalcur = ""
def copyglobal(strfield, strrec):
  if strrec[18:27] == "Currency:" :
    global globalcur
    globalcur = strrec[29:32]  
  if strrec[14:27] == "Organization:" :
    global globalorg
    globalorg = strrec[29:32]
  if strrec[42:47].strip() == 'Total' or strrec[29:34].strip() == 'Total' :
    return fdmSkip
  return strfield
#----------------------------------------------------------------
# Sample to return the global variable set during amount process
#----------------------------------------------------------------
def getCurrfromGlobal(strfield, strrec) :
    return globalcur