4 Replies Latest reply on Jan 27, 2014 2:20 PM by Francisco Amores

    Validation script - reference field name


      Hi everyone


      I have a question pertaining to validation scripts associated with fields of the import formats. I have included a no-data-script which writes a string "NoData" to the field in FDM when parsing the strRecord (this part works fine). I would also like to include an error message as a separate line in a validation report. The error message should reflect the name of the field that caused the error (see red marking below) but I do not know how to reference this in the script. oen alternative would be to maintain separate validation scripts for each field and hard-code the field name but I find that far from ideal. Any input is greatly appreciated.


      For the purpose of discussion I include a simpified example of the script:


      Function Script_NoDataErr(strField, strRecord)
      'Oracle Hyperion FDM IMPORT DataPump Script:
      'Created By:       Admin
      'Date Created:  
      'Purpose:   Check if field is empty and log error if yes

      Dim substituteStr : substituteStr = "NoData"
      Dim errorLogStr: errorLogStr = strField & "cannot be empty" 'needs to be replaced to reflect the field name for which the script is executed


      If Len(strField) = 0 Then
      FSB_NoDataErr = substituteStr
      Log strRecord, errorLogStr
      FSB_NoDataErr = strField
      End If

      End Function

      Sub Log(strEventInfo, strErrorInfo)
      Dim lngLogKey : lngLogKey = 501               'Custom1 Log type
      Dim dteStartTime : dteStartTime = Now()             'Start Date Time
      Dim dteEndTime : dteEndTime = Now()              'End Date Time
      Dim strIOSource : strIOSource = DW.Utilities.fParseString (strEventInfo, 96, 33, "~") 'Record ID
      Dim strStatusCode : strStatusCode = "QMR"            'Log type

      If Len(strIOSource) = 0 Then strIOSource = "N.A."

      'Write Log Entry
      DW.DBTools.mLog CLng(lngLogKey), DW.Connection.PstrUserID, CDate(dteStartTime), CDate(dteEndTime), CStr(strIOSource), CStr(strStatusCode), CStr(strEventInfo), CStr(strErrorInfo)
      End Sub