I am trying to display the parent item category code, along with the Item category code on the item card. I have the code mostly written out, but its not displaying the parent category code in business central, and im not sure what i am missing.
pageextension 50103 MyExtension extends "Item Card"
{
layout
{
// Add changes to page layout here
addafter("No.")
{
field(LegacyId; Rec.LegacyId)
{
ApplicationArea = All;
}
field(MPN; Rec.MPN)
{
ApplicationArea = All;
}
field(Model; Rec.Model)
{
ApplicationArea = All;
}
field(ItemClass; ItemClass)
{
Caption = 'Class';
ApplicationArea = All;
}
}
addafter(GTIN)
{
field(ParentCode; ParentCode)
{
Caption = 'Parent Category';
ToolTip = 'Parent Category';
ApplicationArea = All;
Editable = false;
}
}
addafter(VariantMandatoryDefaultNo)
{
field(Recycle; Rec.Recycle)
{
ApplicationArea = All;
}
}
}
actions
{
// Add changes to page actions here
}
trigger OnOpenPage()
var
ItemCategory: Record "Item Category";
ParentCode: Code[20];
begin
ParentCode := ItemCategory."Parent Category";
SaveRecord();
end;
var
myInt: Integer;
ItemClass: Enum ItemClass;
ParentCode: Code[20];
}