Would someone please point me to documentation on how to incorporate Item Category Codes in to the Logic used in AL Code?
For example, "... if Item Category Code of "Gizmos", then table relationship = ... else ... "
As always, thanks in advance...
-Anthony
Hi, For multiple relationships in TableRelation, you can refer to the No. field on SalesLines.
More details: https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/properties/devenv-tablerelation-property
For example, for Item Category Code
Hope this helps.
Thanks.
ZHU
Thank you, Inge. I will take a look.
[/quote]Please let me know if that was not a good enough sample and i can probably find some more.
You f.ex. will find it also in the general journal line where account type will define what table account no. is related to.
Hi Antmas,
The purpose of item categories is mainly to help you sort and find items.
https://docs.microsoft.com/en-us/dynamics365/business-central/inventory-how-categorize-items
If you wish to see some samples codes that uses item category, You can go to at the below details
Table 5722 - Item Category: It uses parenting and indentation logic.
Codeunit 5722 - Item Category Management
Item Category Relation to other tables
https://dynamicsdocs.com/nav/2018/w1/table/item-category
Please verify and like if you find my answer helpful. Have a nice day and thank you.
Cheers,
Thank you, Inge. I will take a look.
If you look at how they use Source Type and Source Code in the standard application. F.ex. in the Item Ledger Entry table. You will get a good sample there.
Vaishnavi, thank you for your reply.
I am adding a custom field to the Item table with a relationship to other (custom table(s)).
Which of these tables is related would depend on which of the Item Category Codes is selected.
As I understand it, the data type of this ICC field is code, but when I attempt to make the relationship, I receive errors as it seems to want data type option. I've been successful using a workaround by using yet another custom field with options or enums and drive the relationship from that, but this approach doesn't seem very efficient. I'd like to use whatever I can of base functionality.
thanks again
Hi antmas ,
Can you elaborate a bit more what is your requirement do you want to set some value or fetch some thing using Item category code and which table is needed?
FYI Item category code is assigned in Item master.
And if that item is used in Purchase and Sales documents then Item category code is set on their Purchase and Sales lines as well.
If my answer was helpful to you, please verify it so that other users know it worked. Thank you very much
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,524 Super User 2024 Season 2
Martin Dráb 228,469 Most Valuable Professional
nmaenpaa 101,148