MicrosoftDocs / navdevitpro-content-pr

Content for the devitpro release for on-prem & PaaS
Creative Commons Attribution 4.0 International
6 stars 35 forks source link

Cannot assign Tax group to item. #2087

Open djinnet opened 4 years ago

djinnet commented 4 years ago

You cannot assigned a tax group to an item by using REST API Business central. I have looking into the internet and it seems no one had this issue before, so google couldn't really help me here.

When I tried to post an item with a tax group Id, I get this error:

The field Tax Group Id of table Item contains a value that cannot be found in the related table (Tax Group)

The tax group id can be found, since it's the taxgroup with code ZERO in the tax groups endpoint.

The documentation specifies the ID (which is guid) of the Tax Group for the item in the item resource documentation.

Also worth mention that the documentation mentioned that taxGroupCode's type is numeric, but the metadata from the metadata endpoint claimed that taxGroupCode's type is string and have max length for 20 characters. It might be a typo, but still worth mentioned.

My steps to get this error: 1 : Get the ZERO taxgroup by using /taxGroups?$filter=code eq 'ZERO' endpoint 2: Set the taxgroup id to item object. 3: Create item <-- the error showed up.

I hope my steps is easy to reach to the error and it's acceptable to post this issue here.

Thank you for reading my issue.


Dokumentoplysninger

Undlad at redigere denne sektion. Det er påkrævet til docs.microsoft.com ➟ GitHub-problemlinkning.

abc-RKN commented 1 year ago

Is there a solution for this already?

BC 2022 WAVE 1 still has this issue. even if you enter both the ID + code, it still will not work.

If you enter only the Tax Group Code, not the ID you get the same error for the code. If you enter just the Tax Group ID, the error is as described above.