table 50100 CarBrand { DataClassification = ToBeClassified; Caption = 'Car Brand'; fields { field(1; "Car Brand"; Code[20]) { DataClassification = ToBeClassified; Caption = 'Brand'; } field(2; Description; Text[50]) { DataClassification = ToBeClassified; Caption = 'Description'; } field(3; "LogoMedia"; Media) { DataClassification = ToBeClassified; Caption = 'LogoMedia'; } field(4; "LogoMediaSet"; MediaSet) { DataClassification = ToBeClassified; Caption = 'LogoMediaSet'; } field(5; "LogoBlob"; Blob) { DataClassification = ToBeClassified; Caption = 'LogoBlob'; Subtype = Bitmap; } } keys { key(PK; "Car Brand") { Clustered = true; } } }
page 50104 CarBrandCard { PageType = Card; ApplicationArea = All; UsageCategory = Administration; SourceTable = CarBrand; Caption = 'Car brand card'; layout { area(Content) { group(General) { field(CarBrand; Rec."Car Brand") { ApplicationArea = All; ToolTip = 'Brand'; } field(LogoMedia; Rec.LogoMedia) { ApplicationArea = All; ToolTip = 'LogoMedia'; } field(LogoMediaSet; Rec.LogoMediaSet) { ApplicationArea = All; ToolTip = 'LogoMediaSet'; } field(LogoBlob; Rec.LogoBlob) { ApplicationArea = All; ToolTip = 'LogoBlob'; } } } } }
Answers
-try to do calcfields on the field. To ensure it has a value, use .hasvalue.
-To clean image funny but I haven´t with blobs using images (I´ve always used for large texts) but if you assign a blank text should do or assign the blob field value from TempBlob table.
-Mediatype can hold multiple images (read microsoft help). As I only needed one I had to use this piece of code ensure any other was removed:
Thank you for your answer.
I can only use calcfields method on flowfields and blob fields, so I cannot use it on my Media and MediaSet fields.
But once again - thank you for your help.
Best regards,
Morten