2
votes

I'd like to display a picture, that is saved as a blob, on a page that not binds the record.

I created a field in Table 79 of type BLOB and subtype BitMap. Then I added the field TestPicture on Page 1 to actually insert an image manually. It gets displayed correctly on Page 1 (since Page 1 binds Table 79)

However, I want to display this picture on Page 5050 as well, so I added a record of Table 79, filtered the record and did CALCFIELDS.

OnInit():
recCompanyInfo.GET;
recCompanyInfo.CALCFIELDS("TestPicture");

I created a new field on Page 5050 and set the SourceExpr to the BLOB field TestPicture on my added record variable recCompanyInfo.

But it does not show the picture, instead it displays a greyed out text field.

What did I do wrong?

Edit

Dynamics NAV 2009 SP1, RTC

1
At which trigger have you added the code? Probably you should use OnSfterGetRecord. - Mak Sim
@Mark I tried OnInit(), OnOpenPage() and OnAfterGetRecord() - Ello

1 Answers

4
votes

Quick solution is create the same field in table 5050 (Contact) in OnAfterGetRecord() trigger put your Code.

recCompanyInfo.GET;
recCompanyInfo.CALCFIELDS(TestPicture);
TestPicture = recCompanyInfo.TestPicture;

And display in page 5050 the Field TestPicture of the Contact Table.