web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

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

I have the same question (0)
  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hello Waw,

    Are you operating an older AX2012 version?

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

    Best regards,

    Ludwig

  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    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.

  • Waw Profile Picture
    30 on at

    @ Ludwig I am using AX 2012 R3

  • Waw Profile Picture
    30 on at

    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.");

       }

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 611 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans