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

Postman error: "The field with ID '0' does not exist in table 'ResResourceSetupDataEntity'"

(2) ShareShare
ReportReport
Posted on by 77

Hello everyone,

Using the GET method, I’m able to retrieve the project scheduling resource data, which confirms that the record exists in the system and is available for update. I’m trying to update the PeriodId field with the value 'Period' using the PATCH method, but I'm encountering the following error:

"The field with ID '0' does not exist in table 'ResResourceSetupDataEntity'"

GET method:



PATCH method:

I also attempted the same update using the POST method but received the same error.

POST method:

However, when importing the same data with the same values through the Data Management Framework (DMF) for the same data entity, it works without any issues—the value updates successfully with no errors.

 

Would appreciate an exact and working solution or guidance to make this work for the custom entity.

Thanks in advance!

CC: @Martin Dráb

I have the same question (0)
  • Raj Borad Profile Picture
    1,428 on at

    As an error indicates that the PATCH request cannot locate the record by its key ('ID '0''), either the key fields are missing or improperly passed. But in DMF, which can resolve alternate keys and perform background lookups, the OData PATCH method requires exact key values in the URI (e.g., 'ResResourceSetupDataEntity(ResourceID='X',DataAreaId='Y')').
     
    If 'PeriodId' is not part of the key and you're using 'ID=0' incorrectly, the system won’t find the record. Double-check the URI format and ensure you're using all correct primary key fields.
     
    Thanks.
     
  • Martin Dráb Profile Picture
    237,976 Most Valuable Professional on at
    Please use the debugger to find more details about the problem.
     
    Or at least share the full stack trace with us. Your second screenshot shows that you already have the stack trace on hand, but you share just first two lines.
  • AV-17040500-0 Profile Picture
    77 on at
    Thanks @Martin Dráb
    Here is the full response with stack trace:

     
    {
        "error": {
            "code": "",
            "message": "An error has occurred.",
            "innererror": {
                "message": "Error executing code: The field with ID '0' does not exist in table 'ResResourceSetupDataEntity'.",
                "type": "Microsoft.Dynamics.Ax.Xpp.InfoException",
                "stacktrace": "   at Microsoft.Dynamics.Ax.MSIL.Interop.throwException(Int32 ExceptionValue, interpret* ip)\r\n   at Microsoft.Dynamics.Ax.MSIL.cqlCursorIL.fieldState(IntPtr table, UInt32 _fieldId)\r\n   at Microsoft.Dynamics.Ax.Xpp.NativeCommonImplementation.FieldState(Int32 fieldId) in D:\\dbs\\sh\\l23t\\1211_211612\\cmd\\o\\Source\\Kernel\\xppil\\XppSupport\\NativeXppCommonImplementation.cs:line 299\r\n   at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.UpdateProcessor.UpdateEntity_Save(ChangeOperationContext context, ChangeInfo changeInfo)\r\n   at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.ChangeInfo.ExecuteActionsInCompanyContext(IEnumerable`1 actionList, ChangeOperationContext operationContext)\r\n   at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.ChangeInfo.TrySave(ChangeOperationContext operationContext)\r\n   at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.UpdateManager.SaveChanges()\r\n   at Microsoft.Dynamics.Platform.Integration.Services.OData.AxODataDelegatingHandler.<SaveChangesAsync>d__2.MoveNext()"
            }
        }
    }

    I attempted to debug the issue, but since this is a standard data entity and not a custom service class, no methods or loaded symbols are being triggered when sending the request. The entire process completes without hitting any breakpoints or methods, which is why I'm currently unable to debug the issue further.
  • AV-17040500-0 Profile Picture
    77 on at
    Hello @Raj Borad,

    The data entity has two key fields, and I’m including both correctly in the request. While PeriodId is not a key field, I want to update its value—and as per standard behavior, any non-key field can be updated if the key fields are provided correctly in the request. Despite following this approach, I’m still encountering the same error.
  • Martin Dráb Profile Picture
    237,976 Most Valuable Professional on at
    You're wrong in thinking that standard data entities can't be debugged (and that only custom services can). It's possible that it fails before reaching any X++ code you can debug, but it neeeds to be tested. For instance, try putting the breakpoint to ResResourceSetupDataEntity.update(). By the way, don't forget that you aren't limited to methods that are currently overriden by the entity; you can also handle events or add an extension for testing purposes.
     
    Also, look into D:\\dbs\\sh\\l23t\\1211_211612\\cmd\\o\\Source\\Kernel\\xppil\\XppSupport\\NativeXppCommonImplementation.cs to see what happens there at and before the line 299.
  • Suggested answer
    Navneeth Nagrajan Profile Picture
    2,438 Super User 2025 Season 2 on at
    Hi AV-17040500-0,
     
    Updating Resource with the same PeriodId won't work because in the update() method of the data entity ResResourceSetupDataEntity you have the ProjTablePeriodTableRecId validated with the ResourceSetup PeriodId and this blocks you from updating the resource with the same PeriodId multiple times. Check this code updateResourcePeriodCode invoked from ResResourceSetupDataEntity::update() method line number 137.

     

    ResResourceSetupDataEntity::update() -> updateResourcePeriodCode.
     
    Hope this helps.
  • Layan Jwei Profile Picture
    8,118 Super User 2025 Season 2 on at
    Hi AV,

    I it seems the issue doesn't just happen for PeriodId. I just tried it with a boolean field and got the same result and the debugger doesn't catch

  • AV-17040500-0 Profile Picture
    77 on at
    @Layan Jwei,

    I was just using that as an example—you’re right, nothing is being updated through the request in Postman, even though the same update works perfectly fine using DMF. I'm not sure why this discrepancy exists.
  • Suggested answer
    Navneeth Nagrajan Profile Picture
    2,438 Super User 2025 Season 2 on at
    Hi AV-17040500-0,
     
    Tried this scenario on a sandbox on Postman and it looks like the patch operation is trying to update data into D365 F&SCM with '0' PeriodId. That's because the PeriodId is set to 0 explicitly in the parameter for update() method).
    However, through DMF on debugging and placing a breakpoint on update() method it directly invokes the update method and retrieves the PeriodCodeRecId value through the ResourceSetup table.
     
    There is persistEntity() with super() that does validate all the parameters before updating the data through ResResourceSetupDataEntity.
     
     
     
     
  • Martin Dráb Profile Picture
    237,976 Most Valuable Professional on at
    Navneeth, can you tell us more aboout your findings, please? It's not clear to me how empty PeriodId is related to the error message (The field with ID '0' does not exist in table). The error message talks about an ID of a field, not its value. It happens when you try to access a non-existing field, e.g. tableBuffer.(0).
     
    Either there is something more that you didn't tell us (and that's what I'm interested in), or the empty PeriodId isn't actually related to the error.

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
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 422 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans