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, ...
Answered

Getting Error While Run P-0001 Job

(0) ShareShare
ReportReport
Posted on by 396

Hi Everyone,

Hope all are doing well.

Please help me to solve the below error.

I have created a custom table in the channel database with ext schema. My requirement is to pull data from the channel database to HQ database.

For this i have attached this in the existing P-Job. When i am running the p-job, we are getting the below error.

Microsoft.Dynamics.Ax.Xpp.ErrorException: Error occurred in this data upload worker. Last error message: Cannot insert multiple records in LTOperationAuthenticateTable (LTOperationAuthenticateTable). The SQL database has issued an error. Object Server Azure: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]The column name 'CREATEDDATETIME' is specified more than once in the SET clause or column list of an INSERT. A column cannot be assigned more than one value in the same clause. Modify the clause to make sure that a column is updated only once. If this statement updates or inserts columns into a view, column aliasing can conceal the duplication in your code. INSERT INTO LTOPERATIONAUTHENTICATETABLE (CHANNEL,CREATEDDATETIME,LINENUM,LOGONUSERID,MANAGERID,NAME,REPLICATIONCOUNTERFROMORIGIN,RETAILOPERATIONTRANSACTIONID,RETAILOPERATIONTYPE,STORE,TERMINAL,TRANSACTIONLEVEL,CREATEDDATETIME,DATAAREAID,RECVERSION,PARTITION,RECID)SELECT F1,CREATEDDATETIME,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12,CREATEDDATETIME,DATAAREAID,RECVERSION,PARTITION,RECID+5637145330 FROM [##ax_tmp_usrt4315_107_23385] session 4315 (D365DEV4) CDX upload subjob encountered an error while merging the transferred records to the target AX table. CDX subjob encountered an error while applying upload packet. CDX job P-0001 encountered an error while applying package for upload session 22. Upload session 22 failed: CDX job P-0001 encountered an error while applying package for upload session 22. at Dynamics.AX.Application.RetailCDXDataUpload_AX7.`uploadFromClient() in xppSource://Source/Foundation\AxClass_RetailCDXDataUpload_AX7.xpp:line 50 at Dynamics.AX.Application.RetailCDXDataUpload_AX7.uploadFromClient() at Dynamics.AX.Application.RetailCDXDataUpload_AX7.`run() in xppSource://Source/Foundation\AxClass_RetailCDXDataUpload_AX7.xpp:line 8 at Dynamics.AX.Application.RetailCDXDataUpload_AX7.run() at Dynamics.AX.Application.SysOperationSandbox.`startOperation(SysOperationIMarshalledRun operationInstance) in xppSource://Source/ApplicationPlatform\AxClass_SysOperationSandbox.xpp:line 100 at Dynamics.AX.Application.SysOperationSandbox.startOperation(SysOperationIMarshalledRun operationInstance) at Dynamics.AX.Application.Runbase.`runOperation() in xppSource://Source/ApplicationPlatform\AxClass_Runbase.xpp:line 804 at Dynamics.AX.Application.Runbase.runOperation() at Dynamics.AX.Application.RetailCDXScheduleRunner.`runUploadTask(Int64 _dataGroupRecID, String _jobID, Int64 _lastSyncVer) in xppSource://Source/Foundation\AxClass_RetailCDXScheduleRunner.xpp:line 759 at Dynamics.AX.Application.RetailCDXScheduleRunner.runUploadTask(Int64 _dataGroupRecID, String _jobID, Int64 _lastSyncVer) at Dynamics.AX.Application.RetailCDXScheduleRunner.`processRegular() in xppSource://Source/Foundation\AxClass_RetailCDXScheduleRunner.xpp:line 335 at Dynamics.AX.Application.RetailCDXScheduleRunner.processRegular() at Dynamics.AX.Application.RetailCDXScheduleRunner.`run() in xppSource://Source/Foundation\AxClass_RetailCDXScheduleRunner.xpp:line 449

Thanks in advance....

I have the same question (0)
  • Verified answer
    André Arnaud de Calavon Profile Picture
    301,109 Super User 2025 Season 2 on at

    Hi Pankaj,

    The error clearly mentions that the column CreatedDateTime is set twice. This is also confirmed by the SQL statement. You have to review the way you fill this custom table.

  • Pankaj_93 Profile Picture
    396 on at

    Hi Andre,

    Thank you for your quick response.

    This issue has been resolved.

    Now we are getting another error.

    Please find the below error.

    Microsoft.Dynamics.Ax.Xpp.ErrorException: Error occurred in this data upload worker. Last error message: Error when bulk inserting data. Target table: LTOPERATIONAUTHENTICATETABLE System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: The given ColumnMapping does not match up with any column in the source or destination. at System.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Add(SqlBulkCopyColumnMapping bulkCopyColumnMapping) at Dynamics.AX.Application.RetailConnSCDataBulkCopy.`bulkCopyToTemp(String physicalTempDBTableName) in xppSource://Source/Foundation\AxClass_RetailConnSCDataBulkCopy.xpp:line 70 --- End of inner exception stack trace --- CDX upload subjob encountered an error while staging its upload packet to a temporary table. CDX subjob encountered an error while applying upload packet. CDX job P-0001 encountered an error while applying package for upload session 22. Upload session 22 failed: CDX job P-0001 encountered an error while applying package for upload session 22. at Dynamics.AX.Application.RetailCDXDataUpload_AX7.`uploadFromClient() in xppSource://Source/Foundation\AxClass_RetailCDXDataUpload_AX7.xpp:line 50 at Dynamics.AX.Application.RetailCDXDataUpload_AX7.uploadFromClient() at Dynamics.AX.Application.RetailCDXDataUpload_AX7.`run() in xppSource://Source/Foundation\AxClass_RetailCDXDataUpload_AX7.xpp:line 8 at Dynamics.AX.Application.RetailCDXDataUpload_AX7.run() at Dynamics.AX.Application.SysOperationSandbox.`startOperation(SysOperationIMarshalledRun operationInstance) in xppSource://Source/ApplicationPlatform\AxClass_SysOperationSandbox.xpp:line 100 at Dynamics.AX.Application.SysOperationSandbox.startOperation(SysOperationIMarshalledRun operationInstance) at Dynamics.AX.Application.Runbase.`runOperation() in xppSource://Source/ApplicationPlatform\AxClass_Runbase.xpp:line 804 at Dynamics.AX.Application.Runbase.runOperation() at Dynamics.AX.Application.RetailCDXScheduleRunner.`runUploadTask(Int64 _dataGroupRecID, String _jobID, Int64 _lastSyncVer) in xppSource://Source/Foundation\AxClass_RetailCDXScheduleRunner.xpp:line 759 at Dynamics.AX.Application.RetailCDXScheduleRunner.runUploadTask(Int64 _dataGroupRecID, String _jobID, Int64 _lastSyncVer) at Dynamics.AX.Application.RetailCDXScheduleRunner.`processRegular() in xppSource://Source/Foundation\AxClass_RetailCDXScheduleRunner.xpp:line 335 at Dynamics.AX.Application.RetailCDXScheduleRunner.processRegular() at Dynamics.AX.Application.RetailCDXScheduleRunner.`run() in xppSource://Source/Foundation\AxClass_RetailCDXScheduleRunner.xpp:line 449  

    ? Error occurred in this data upload worker. Last error message: Error when bulk inserting data. Target table: LTOPERATIONAUTHENTICATETABLE System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: The given ColumnMapping does not match up with any column in the source or destination. at System.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Add(SqlBulkCopyColumnMapping bulkCopyColumnMapping) at Dynamics.AX.Application.RetailConnSCDataBulkCopy.`bulkCopyToTemp(String physicalTempDBTableName) in xppSource://Source/Foundation\AxClass_RetailConnSCDataBulkCopy.xpp:line 70 --- End of inner exception stack trace --- CDX upload subjob encountered an error while staging its upload packet to a temporary table. CDX subjob encountered an error while applying upload packet. CDX job P-0001 encountered an error while applying package for upload session 22. Upload session 22 failed: CDX job P-0001 encountered an error while applying package for upload session 22.

    This below is the structure of the table of ext and dbo.

    pastedimage1581667575439v1.pngpastedimage1581667631130v2.png

  • Verified answer
    André Arnaud de Calavon Profile Picture
    301,109 Super User 2025 Season 2 on at

    Hi Pankaj,

    Not all fields do have the same definition. E.g. the ManagerId is not allowing null values in the "DBO" table and also the LineNum has another field type. There are some more differences. Can you check if e.g. some fields are blank in the "EXT" table or that the data type difference on the LineNum is causing the issue?

  • Pankaj_93 Profile Picture
    396 on at

    Hi Andre,

    Thank you very much for your help.

    It helps me to solve all my issues. 
    One last doubt i have, 

    In the above table structure, there is one field TenderLineId in the ext table but not in the dbo table. Will it make any issue at the time of P-0001 job run? Will it throw any exception like previous that column mapping issue?

    Basically, I do not want to send this value to the HQ. This filed i am using this field for an update purpose of another field.

  • Verified answer
    André Arnaud de Calavon Profile Picture
    301,109 Super User 2025 Season 2 on at

    Hi Pankaj,

    When the field is not mapped, it will not give an error during the copy process. I'm not sure if this field has value for the retail statement posting. Probably it is OK, but never looked in detail in the content of the POS database.

  • Pankaj_93 Profile Picture
    396 on at

    Hi Andre,

    Thank you very much for your quick response...

    It helped me great..

    Now i am able to do pull data from channel database to HQ.

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 451 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans