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 :
Microsoft Dynamics AX (Archived)

insert_recordset dynamically adds another field when attemptingto add createdDateTime

(0) ShareShare
ReportReport
Posted on by 3,155

I am working with the LedgerTransListDate report... Which led me back to the LedgerTransListReportHelper class and the createReportData method.

I added 2 new fields to the appropriate TMP tables (there are 2).

I then added my fields to the field list of the insert_recordset and to the select. Compiles fine.

I then get an error from sql:

SQL error description: [Microsoft][SQL Server Native Client 10.0][SQL Server]The select list for the INSERT statement contains fewer items than the insert list. The number of SELECT values must match the number of INSERT columns.

That's a pretty straight forward error, however, the count in my method looked fine. So, after inspecting the sql statement a little closer I found my 2 fields PLUS a third field that has 'TZID' (Time Zone ID??) added to the end.  I presume that this field is throwing the count off.

...,MYFIELD_CREATEDBY,MYFIELD_CREATEDDATETIME,MYFIELD_CREATEDDATETIMETZID,...

Any idea why this field is added to the insert list and how to make this work correctly?

*This post is locked for comments

I have the same question (0)
  • Douglas Noel Profile Picture
    3,905 on at

    Hi bRradlyJames,

    can you please take a look at the following thread: 

    http://community.dynamics.com/ax/f/33/p/173963/431944

    This is a similar issue.

    It seems that using this System DateTime fields (setup by table properties - ModifiedDateTime, CreatedDateTime) within an insert_recordset for copying into a utcDateTime field is currently unsupported. These fields do not have a extra timezone (_TZID) column. (Which maybe can be simulated using a 'constant' value within the select field list.

    But this is pure kernel functionality - only the people at MS are able to fix this.

    Maybe you should launch an support request or an entry on Connect for that.

    regards and sorry

    Douglas

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans