Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Payroll Integration Error

(0) ShareShare
ReportReport
Posted on by 30

I am getting the below error while trying to open payroll integration.  

pastedimage1604392450127v1.png

  • Waw Profile Picture
    30 on at
    RE: Payroll Integration Error

    The issue started this week.  

    Here is my code (IBSpayrollconnector_periodsload)

    static public void Main(Args  _args,str _sql)

    {

       IBSpayrollconnector_periodsload payroll = new IBSpayrollconnector_periodsload();

       LoginProperty loginProperty;

       OdbcConnection odbcConnection;

       Statement statement;

       ResultSet resultSet;

       str sqlstatement, criteria, pmonth="" , pyear="";

       SqlStatementExecutePermission perm;

       IBSpayrollperiod  _pwrkflw;

       ;

       // Set the information on the ODBC.

       loginProperty = new LoginProperty();

       loginProperty.setDSN("Pay");

       loginProperty.setDatabase("dbname");

       //info("periods");

       //Create a connection to external database.

       odbcConnection = new OdbcConnection(loginProperty);

         sqlstatement = _sql;

       if (odbcConnection)

       {

           //Assert permission for executing the sql string.

           perm = new SqlStatementExecutePermission(sqlstatement);

           perm.assert();

           //Prepare the sql statement.

           statement = odbcConnection.createStatement();

           resultSet = statement.executeQuery(sqlstatement);

             ttsBegin;

                delete_from _pwrkflw where _pwrkflw.IBSpayrollWorkflowState == 0;

              ttsCommit;

            //Cause the sql statement to run,

           //then loop through each row in the result.

           while (resultSet.next())

           {

               //It is not possible to get field 3 and then 1.

               //Always get fields in numerical order, such as 1 then 2 the 3 etc.

                ttsBegin;

                _pwrkflw.Pyear =resultSet.getString(1) ;

                _pwrkflw.Pmonth = resultSet.getString(2);

                _pwrkflw.insert();

                ttsCommit;

                    // info ("completed succesfully");

           }

           //Close the connection.

           resultSet.close();

           statement.close();

       }

       else

       {

           error("Failed to log on to the database through ODBC.");

       }

  • Waw Profile Picture
    30 on at
    RE: Payroll Integration Error

    @ Ludwig I am using AX 2012 R3

  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,421 on at
    RE: Payroll Integration Error

    Hi Waw,

    Do you have an SQL statements in the integration and have used "INSERT" command instead of a "SELECT" command anywhere in the integration code? Please check this thread where a similar error is discussed.

  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at
    RE: Payroll Integration Error

    Hello Waw,

    Are you operating an older AX2012 version?

    If so, have you already checked LCS for available hotfixes?

    Best regards,

    Ludwig

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,118 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,866 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans