1

I would like to make image bigger on an item list in Dynamics Nav 2013. What I could do so far is fetch the image and display it on the list.

enter image description here

To achieve this I call SearchImage function on OnAfterGetRecord :

OnAfterGetRecord()
SearchImage;

SearchImage function :

// C/AL Code
SearchImage()
//MESSAGE('1');

IF xRec."No."<>"No." THEN BEGIN
//MESSAGE('1');
  CLEAR(TmpImg_gInit);
  TmpImg_gInit.INIT;
  //CurrPage.PictBox2.PAGE.SetRec(TmpImg_gInit);
  //CurrPage.PictBox3.PAGE.SetRec(TmpImg_gInit);

  i := 1;
  //MESSAGE(FORMAT(TIME));
  TmpImg_gInit.INIT;
  TmpImg_gInit.RESET;
  TmpImg_gInit.SETCURRENTKEY("Table ID","Document Type","No.","Line No.","Version No.","Picture No.");
  TmpImg_gInit.SETRANGE("Table ID",27);
  TmpImg_gInit.SETRANGE("Document Type",0);
  TmpImg_gInit.SETRANGE("No.","No.");
  //TmpImg_g.SETAUTOCALCFIELDS(Picture);
  IF TmpImg_gInit.FINDFIRST THEN BEGIN
    TmpImg_gInit.CALCFIELDS(Picture);
  END;

  //MESSAGE(FORMAT(TIME));

  REPEAT
    TmpImg_gInit.CALCFIELDS(Picture);

    i:= i+1;
    xRec."No.":="No.";
  UNTIL TmpImg_gInit.NEXT = 0;
//  CUDiv.SendKey('{F5}');
END;

Then in my list I can add a new field that point to TmpImg_gInit.Picture and this will display the item's image.

The thing is the displayed image is tiny (whereas the source image is big). The image is automatically resized to fit in the list height.

I would like to know how I could display this image bigger. Is there a way to do that easily (without add-ins) ? If not can you give me directions on how to do that ?

Arno 2501
  • 8,921
  • 8
  • 37
  • 55

1 Answers1

2

You can use a FactBox which will display a larger image on the right hand side of the screen.

However, it will only show the picture of the item that you've selected. For things like product images, this is optimal. E.g. loading lots of hi-res product images can put strain on the users PC.

The image size when inline on a page cannot be changed and are better suited to things like Status icons, e.g. traffic lights.

Custom Control Add-ins

NAV does support modification of the page UI through Control Add-ins. You'll need to create a test project/control that is an image and see whether it will let you expand the height above the set row height.

You can get more information on sizing of Control Add-ins on MSDN.

Jake Edwards
  • 1,190
  • 11
  • 24
  • We have the requirement to display the images on the list. It's a need from the business that cannot be changed. The photos do not need to be very high resolution though but it has to be big enough to have a descent idea of the product. By the way this was possible in Nav 2009. Is there a way to do this using a custom add-ins ? – Arno 2501 Mar 04 '15 at 08:24
  • 1
    Yes, you can usually always achieve custom UI scenarios with Control Add-ins. I'd recommend deploying them with ClickOnce or NAV 2015 (which downloads them dynamically). This saves them having to be manually installed on each user's PC. This applies to the Windows Client only. – Jake Edwards Mar 04 '15 at 08:26
  • Could you show me directions on how to create an add-in that would display a bigger image in a list ? – Arno 2501 Mar 04 '15 at 08:27
  • What I would like to know more specifically is can I create an image control and use it in an existing list or should I create a whole custom list. – Arno 2501 Mar 04 '15 at 08:30
  • I've put some more detail in my answer. Ultimately you'll need to create a custom add-in and try it. It definitely works in Factboxes and Page Cards, Page Lists are the only ones I haven't tried. There's a link specific to control sizing above. – Jake Edwards Mar 04 '15 at 08:36