Error Importing Employee List -- EmpEE Fld2-Calc Name

I have a program that uses the COM SDK to import (Update) the Employee list with Hours and Payrate.  We converted from 2012 to 2015.  I updated the program to use the 2015.2 SDK.  But I get an error when trying to Import:

EmpEE Fld2-Calc Name

I don't even know what this field is.  I am not addressing that field (as far as I know).  What could cause this?

  • 0

    CalcName is an enumeration that exists for several types including PeachwIEObjEmployeeListField. What is the full error message that you're receiving? Are you able to debug through your application and see what  data it's trying to import to that field?

  • 0 in reply to wood

    Thanks for the response.  Here is the full error:

    An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in CustomPR2015.exe

    Additional information: An error occurred while importing!

    This happened for Field Name: Pay Frequency

    When I removed Pay Frequency from the Import, that's when it started putting in EmpEE Fld2-Calc Name for the Field Name.  The code is pretty straight forward:

       Public Sub COMPost()

           '2/20/2012 - Use COM Object to transfer to Peachtree

           '2/20/2015 - Upgrades for Sage 5.0

           Dim sMes As String

           sMes = "Importing"

           InitializeEmployeeListImport()

           Dim pwConnImp As Interop.PeachwServer.Import

           pwConnImp = CType(frmMain.ptApp.CreateImporter(PeachwIEObj.peachwIEObjEmployeeList), Import)

           With pwConnImp

               .ClearImportFieldList()

               .SetWarnBeforeImportingDuplicates(False)

               .SetFileType(Interop.PeachwServer.PeachwIEFileType.peachwIEFileTypeCSV)

               .SetFilename("C:\Program Files (x86)\CustomPR\PRTran.csv")

               .SetFileIncludesHeadersFlag(1)

               .AddToImportFieldList(0)

               .AddToImportFieldList(17)

               .AddToImportFieldList(20)

               .AddToImportFieldList(24)

               .AddToImportFieldList(29)

               .AddToImportFieldList(44)

               .AddToImportFieldList(45)

               .AddToImportFieldList(49)

           End With

           pwConnImp.Import()                '----  Error occurs here

       End Sub

       Public Sub InitializeEmployeeListImport()

           ReDim FieldArray(49)

    FieldArray(Interop.PeachwServer.PeachwIEObjEmployeeListField.peachwIEObjEmployeeListField_EmployeeID) = "Employee ID"

    FieldArray(Interop.PeachwServer.PeachwIEObjEmployeeListField.peachwIEObjEmployeeListField_ExtraFit) = "Extra Federal Income Tax"

    FieldArray(Interop.PeachwServer.PeachwIEObjEmployeeListField.peachwIEObjEmployeeListField_StateNum) = "State Number"

           FieldArray(Interop.PeachwServer.PeachwIEObjEmployeeListField.peachwIEObjEmployeeListField_LocalNum) = "Local Number"

           FieldArray(Interop.PeachwServer.PeachwIEObjEmployeeListField.peachwIEObjEmployeeListField_Special1Num) = "Special Number 1"

           FieldArray(Interop.PeachwServer.PeachwIEObjEmployeeListField.peachwIEObjEmployeeListField_PayFrequency) = "Pay Frequency"

           FieldArray(Interop.PeachwServer.PeachwIEObjEmployeeListField.peachwIEObjEmployeeListField_HoursPerPeriod) = "Hours Per Period"

           FieldArray(Interop.PeachwServer.PeachwIEObjEmployeeListField.peachwIEObjEmployeeListField_Rate1) = "Rate 1"

       End Sub